remove delays from BME280 demo, no longer needed
This commit is contained in:
parent
fbd9ae4b67
commit
36322fd737
@ -136,9 +136,6 @@ bool app_loop() {
|
|||||||
|
|
||||||
application_state.mode_changed = false;
|
application_state.mode_changed = false;
|
||||||
|
|
||||||
delay_ms(250);
|
|
||||||
application_state.debounce_wait = false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,9 +339,6 @@ void set_time_mode_handle_secondary_button() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cb_mode_pressed() {
|
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 = (application_state.mode + 1) % NUM_MODES;
|
||||||
application_state.mode_changed = true;
|
application_state.mode_changed = true;
|
||||||
application_state.mode_ticks = 300;
|
application_state.mode_ticks = 300;
|
||||||
@ -352,9 +346,6 @@ void cb_mode_pressed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cb_light_pressed() {
|
void cb_light_pressed() {
|
||||||
if (application_state.debounce_wait) return;
|
|
||||||
application_state.debounce_wait = true;
|
|
||||||
|
|
||||||
switch (application_state.mode) {
|
switch (application_state.mode) {
|
||||||
case MODE_PREFS:
|
case MODE_PREFS:
|
||||||
prefs_mode_handle_secondary_button();
|
prefs_mode_handle_secondary_button();
|
||||||
@ -369,9 +360,6 @@ void cb_light_pressed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cb_alarm_pressed() {
|
void cb_alarm_pressed() {
|
||||||
if (application_state.debounce_wait) return;
|
|
||||||
application_state.debounce_wait = true;
|
|
||||||
|
|
||||||
switch (application_state.mode) {
|
switch (application_state.mode) {
|
||||||
case MODE_LOG:
|
case MODE_LOG:
|
||||||
log_mode_handle_primary_button();
|
log_mode_handle_primary_button();
|
||||||
|
@ -30,7 +30,6 @@ typedef struct ApplicationState {
|
|||||||
bool led_on; // Indicates that the LED is on
|
bool led_on; // Indicates that the LED is on
|
||||||
uint8_t page; // Tracks the current page in log, prefs or settings.
|
uint8_t page; // Tracks the current page in log, prefs or settings.
|
||||||
bool is_fahrenheit; // User preference, C or F
|
bool is_fahrenheit; // User preference, C or F
|
||||||
bool debounce_wait; // For debouncing button inputs
|
|
||||||
|
|
||||||
// Data logging
|
// Data logging
|
||||||
SensorReading logged_data[MAX_DATA_POINTS];
|
SensorReading logged_data[MAX_DATA_POINTS];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user