]> git.earman.xyz Git - sensor-watch.git/commitdiff
remove delays from BME280 demo, no longer needed
authorJoey Castillo <jose.castillo@gmail.com>
Mon, 30 Aug 2021 21:58:53 +0000 (17:58 -0400)
committerJoey Castillo <jose.castillo@gmail.com>
Mon, 30 Aug 2021 21:58:53 +0000 (17:58 -0400)
Sensor Watch BME280 Project/app.c
Sensor Watch BME280 Project/app.h

index 59090ea3dcfc295a8d93bff53b9fc8298d08e2cd..344a2e1b429d09b66ec22d2565ae560fb9e6f561 100644 (file)
@@ -136,9 +136,6 @@ bool app_loop() {
 
     application_state.mode_changed = false;
 
-    delay_ms(250);
-    application_state.debounce_wait = false;
-
     return true;
 }
 
@@ -342,9 +339,6 @@ void set_time_mode_handle_secondary_button() {
 }
 
 void cb_mode_pressed() {
-    if (application_state.debounce_wait) return;
-    application_state.debounce_wait = true;
-
     application_state.mode = (application_state.mode + 1) % NUM_MODES;
     application_state.mode_changed = true;
     application_state.mode_ticks = 300;
@@ -352,9 +346,6 @@ void cb_mode_pressed() {
 }
 
 void cb_light_pressed() {
-    if (application_state.debounce_wait) return;
-    application_state.debounce_wait = true;
-
     switch (application_state.mode) {
         case MODE_PREFS:
             prefs_mode_handle_secondary_button();
@@ -369,9 +360,6 @@ void cb_light_pressed() {
 }
 
 void cb_alarm_pressed() {
-    if (application_state.debounce_wait) return;
-    application_state.debounce_wait = true;
-
     switch (application_state.mode) {
         case MODE_LOG:
             log_mode_handle_primary_button();
index 85076698afee014774b8854c090cd9021ee4f6ea..e0bbe1c2514d250ad816d967c9759e9d20108a3a 100644 (file)
@@ -30,7 +30,6 @@ typedef struct ApplicationState {
     bool led_on;            // Indicates that the LED is on
     uint8_t page;           // Tracks the current page in log, prefs or settings.
     bool is_fahrenheit;     // User preference, C or F
-    bool debounce_wait;     // For debouncing button inputs
 
     // Data logging
     SensorReading logged_data[MAX_DATA_POINTS];