refactor(event): replace global 60s inactivity timer with per-second tick event
Adds KEY_EVENT_SECOND_TICK, generated once per real second from Clock_IncMS() via a new second_tick_flag and pushed through the normal event queue, so every foreground App's onEvent() receives it and decides independently whether to act. Removes the old global inactivity_timer (60s sleep from anywhere) entirely. HomeApp now accumulates its own idle-second counter and sleeps after 10s idle specifically while on the home screen; MenuApp's existing 10s auto-close is converted from onRun() polling to the same tick+reset pattern for consistency. Any non-tick key event resets each app's own counter to 0.
This commit is contained in:
@@ -443,9 +443,6 @@ void Wakeup_Restore(void)
|
||||
// 6. 延时 200ms 等待液晶稳压板上电稳定后,重新对 LCD 寄存器初始化
|
||||
Delay_ms(200);
|
||||
LCD_Init();
|
||||
|
||||
// 7. 充零闲置计时器
|
||||
inactivity_timer = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user