|
|
|
@ -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); |
|
|
|
|