blbuvzdor 2 - exit manual mode after 1 hour
This commit is contained in:
@@ -65,6 +65,7 @@ static void read_time_and_moisture()
|
||||
} else {
|
||||
uint8_t cur_wd = s_app.rtc_time.weekday;
|
||||
if (cur_wd != prev_wd) {
|
||||
// Weekday change, decide now
|
||||
s_app.today_is_watering_day = false;
|
||||
uint8_t now_normalized = cur_wd + (cur_wd < s_app.last_watering_day_wd ? 7 : 0);
|
||||
uint8_t elapsed_days = now_normalized - s_app.last_watering_day_wd;
|
||||
@@ -143,6 +144,13 @@ void gui_loop_iter(GuiEvent message)
|
||||
}
|
||||
}
|
||||
|
||||
// exit manual mode after long time
|
||||
if (s_app.screen == screen_manual_control) {
|
||||
if ((tickNow - s_app.screen_open_time) >= (3600 * 1000)) {
|
||||
switch_screen(screen_home, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Read RTC every second
|
||||
if (tickNow - s_app.last_1s_time >= 1000) {
|
||||
s_app.screen(GUI_EVENT_SCREEN_TICK_1S);
|
||||
|
||||
@@ -79,7 +79,7 @@ struct State {
|
||||
uint16_t moisture_raw;
|
||||
uint16_t moisture_pt;
|
||||
struct rtc_time last_cycle_time;
|
||||
bool cycle_time_checking;
|
||||
bool cycle_time_checking; // TODO unclear what this does???
|
||||
|
||||
/// Repaint was requested from the screen code
|
||||
bool paint_needed;
|
||||
|
||||
Reference in New Issue
Block a user