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

@@ -168,6 +168,7 @@ void Self_Test(void)
Uart_SendString("\r\n========================================\r\n");
Uart_SendString("[SELF-TEST] System Power-On Self Test...\r\n");
#if USE_PCF8563
// 执行 I2C 总线器件扫描,查找 RTC 是否物理响应
PCF8563_ScanDiagnostic();
@@ -198,6 +199,9 @@ void Self_Test(void)
// 0.2 执行 RTC 底层单独试读测试
PCF8563_TryReadDiagnostic();
#else
Uart_SendString("[SELF-TEST] USE_PCF8563=0, skipping RTC/I2C diagnostics.\r\n");
#endif
// 1. 验证 PWR_HOLD 锁存状态
if (PWR_HOLD == 1) {