feat(ui): show real weekday/day/month on HOME screen instead of placeholder

UI_ShowClockPage()/UI_ShowSetTimePage() now take weekday/day/month(/year)
and build the date bar dynamically via Build_DateString() instead of
the fixed placeholder string. app_home.c reads the full date from RTC
via PCF8563_ReadDateTime() and recalculates weekday since the RTC's
stored date may differ from the software clock's. config.h exposes
current_day/month/year/weekday alongside the existing time fields so
main.c's debug commands don't need a separate include.
This commit is contained in:
edisondeng
2026-07-31 19:43:43 +08:00
parent 81ebf7e302
commit 6baf93c550
5 changed files with 131 additions and 36 deletions

View File

@@ -141,6 +141,10 @@ extern SystemState current_state; // 系统当前整体运行状态
extern u8 current_hour; // 当前系统时间:小时
extern u8 current_min; // 当前系统时间:分钟
extern u8 current_sec; // 当前系统时间:秒
extern u8 current_day; // 当前系统日期:日
extern u8 current_month; // 当前系统日期:月
extern u8 current_year; // 当前系统日期:年 (0~99代表 2000~2099)
extern u8 current_weekday; // 当前系统日期:星期 (0=周日, ..., 6=周六)
extern volatile u8 clock_updated; // 时钟分钟更新标志 (1表示需要刷新待机页时间)
extern volatile bit second_tick_flag; // 整秒滴答标志位,每秒置 1由主循环转换为 KEY_EVENT_SECOND_TICK 事件