feat(config): add USE_PCF8563 build switch to run without the RTC chip

Some PCB variants may not populate the PCF8563. Guards RTC init/read
in HomeApp_OnStart(), the WriteDateTime() save in SetClockApp, and the
I2C/RTC diagnostic scans in Self_Test() behind #if USE_PCF8563. When
disabled, the firmware runs entirely on the Timer1-driven software
clock; date/time just won't survive a power cycle without the chip.
This commit is contained in:
edisondeng
2026-07-31 19:54:18 +08:00
parent 6022f0a409
commit 0ef5991d33
4 changed files with 15 additions and 0 deletions

View File

@@ -159,8 +159,10 @@ static EventResult SetClockApp_onEvent(SystemEvent *evt)
// 短按 ■ 确认键保存最新时间与日期配置,退出到主菜单 (父 App)
current_state = STATE_PAIR_MENU;
#if USE_PCF8563
// 同步将最新时间与日期 (含算好的星期) 一次性写入 PCF8563 芯片寄存器
PCF8563_WriteDateTime(current_hour, current_min, 0, current_day, current_month, current_year, current_weekday);
#endif
// 退出短振反馈
MOTOR = 1; Delay_ms(50); MOTOR = 0;