feat(ui): extend set_clock_app to edit day/month/year, not just time

time_edit_field now cycles through 5 fields (hour/min/day/month/year)
via long-press CONFIRM. Up/down adjusts whichever field is focused,
with day clamped to Days_In_Month() when month/year changes, and
Clock_RecalcWeekday() called after every date edit so the weekday
label stays in sync. UI_UpdateSetTimeDigit() now also refreshes the
weekday abbreviation when editing day/month/year, since the computed
weekday can change independently of which digit was actually touched.
Save writes the full date+weekday via PCF8563_WriteDateTime(). Also
removes PCF8563_ReadTime()/WriteTime(), now unused since every caller
was updated to the DateTime variants directly.
This commit is contained in:
edisondeng
2026-07-31 19:53:56 +08:00
parent 6baf93c550
commit 6022f0a409
5 changed files with 73 additions and 88 deletions

View File

@@ -24,24 +24,6 @@
*/
bit PCF8563_Init(void);
/**
* @brief 从 PCF8563 芯片读取当前时间 (时、分、秒)
* @param hour 小时指针 (0~23)
* @param min 分钟指针 (0~59)
* @param sec 秒钟指针 (0~59)
* @return bit 1: 读取成功, 0: 通讯失败
*/
bit PCF8563_ReadTime(u8 *hour, u8 *min, u8 *sec);
/**
* @brief 将指定的时间 (时、分、秒) 写入 PCF8563 芯片
* @param hour 小时 (0~23)
* @param min 分钟 (0~59)
* @param sec 秒钟 (0~59)
* @return bit 1: 写入成功, 0: 通讯失败
*/
bit PCF8563_WriteTime(u8 hour, u8 min, u8 sec);
/**
* @brief 从 PCF8563 芯片连续读取时间与日期 (时/分/秒/日/月/年)
* @param hour 小时指针 (0~23)