Commit Graph

16 Commits

Author SHA1 Message Date
edisondeng
1146bade70 feat(rtc): add PCF8563 full date read/write (day/month/year/weekday)
PCF8563's second/minute/hour/day/weekday/month/year registers are
contiguous (0x02-0x08), so PCF8563_ReadDateTime() bursts all 7 bytes
in one transaction. PCF8563_ReadTime() becomes a thin wrapper that
discards the date fields. WriteTime() is kept as its own 3-byte-only
implementation (writing only sec/min/hour) rather than routed through
the new WriteDateTime(), since forcing it through a 7-byte write would
require synthesizing date values and risk corrupting the stored date;
WriteDateTime() is added as a separate full 7-byte write for callers
that actually have real date+weekday values to persist.
2026-07-31 19:30:02 +08:00
edisondeng
ec556fdd2a fix(boot): hold backlight off until first frame is drawn
SGM_CTRL was turned on at the very start of LCD_Init(), before the
ST7789V register sequence and first frame ran, showing garbage/blank
content briefly on every boot. GPIO_Init() now forces backlight off at
power-on, LCD_Init() no longer touches it, and main() only turns it on
right before entering the main loop (after HomeApp's first frame is
drawn). Wakeup_Restore()'s existing on-then-reinit sequence is
untouched since it sets the level itself before calling LCD_Init().
2026-07-31 18:09:39 +08:00
edisondeng
4a89aef71e fix(rf): true single-edge P3.6 trigger + pull-down, restore edge decode
Root cause found via datasheet: PxIM0/PxIM1 has no dual-edge mode, only
falling/rising/low-level/high-level. (IM1=1,IM0=1) was actually
high-level interrupt, refiring continuously for the whole high-pulse
duration (confirmed by scope: no real HF noise, and edge_count=0 when
P3.6 grounded). Fix: start in rising-edge mode, software-toggle to the
opposite edge on every trigger (ping-pong) to emulate true dual-edge
triggering, feeding exact edge direction into the incremental decode
state machine (no glitch filter needed). Also switch P3.6 idle bias
from pull-up to pull-down, since floating-high under the old high-level
mode caused the interrupt-storm boot issue; removed the now-conflicting
pull-up restore in Wakeup_Restore().
2026-07-31 16:39:06 +08:00
edisondeng
29194a4f5d debug(rf): revert to polling EV1527_Decode, ISR does pure edge counting
Diagnostic experiment: restore the commit d8df5d4 polling decode
algorithm/thresholds unchanged, while P3.6 ISR now only increments an
edge counter (no decode state machine). Successful decodes print the
edge-count delta over the decode window to compare against the
EV1527 theoretical 50-edges-per-frame, to validate/refute the
edge-interrupt glitch-noise hypothesis.
2026-07-31 15:53:15 +08:00
edisondeng
767aa14086 fix(timer): compensate Timer0_GetTimestamp for pending TF0 overflow
TH0/TL0 torn-read protection didn't cover the case where the hardware
counter already wrapped but Timer0_Isr hasn't run yet to bump
timer0_ovf_count, making the timestamp appear to jump backward by one
overflow period (~32.768ms). Read TF0 under a brief EA guard and treat
a pending-but-unserviced overflow as ovf+1 without clearing it.
2026-07-31 15:52:50 +08:00
edisondeng
a7a2cc9465 暂存 2026-07-31 13:57:06 +08:00
edisondeng
d8df5d49d3 fix: 修复 main.c/event.c/lcd.c 的中文注释乱码,统一为 UTF-8 编码
lcd.c 原本整体是 GBK 编码,直接转码即可。main.c 与 event.c 曾被
Keil 环境以错误编码保存导致部分注释损坏,本次以历史提交中未损坏的
版本为基底恢复正确注释文本,并将其后新增的真实代码改动(RGB 三色
诊断指令、SOS 按键状态机解锁)对应的注释一并还原,不涉及任何代码逻辑变更。
2026-07-31 09:54:59 +08:00
58dfe5bb9c debug: 增加 Loopback_Test 硬件电气回环自检及对应的调试串口指令 'l' 2026-07-29 10:16:05 +08:00
0a79e7a3b9 fix: 重构 EV1527 发射时序,使用硬件 Timer0 保证 100% 精准码宽延迟以成功触发接收机 2026-07-29 09:40:54 +08:00
d01121e3ae feat: 校准电池电压与ADC2充电检测,重构RGB为Bitbang翻转驱动,并修复RTC晶振起振问题 2026-07-28 18:08:40 +08:00
Antigravity IDE
47bcd252b2 修正1.14寸屏幕垂直偏置并添加自动清屏以清除开机噪声;修正新硬件射频收发引脚对调,低功耗唤醒中断重定向至P3.6中断16;添加一键串口收发诊断测试指令,并临时屏蔽SOS物理按键 2026-07-17 19:43:02 +08:00
Antigravity IDE
c0d1fe74f5 重构手环软件架构:实现动态挂载前后台 App 框架,解耦拆分源文件,并引入统一日志宏 xtell.h 2026-07-17 09:08:53 +08:00
Antigravity IDE
8fdbb32f42 fix(rf): 补齐 rf.c 里的 Uart_SendHex32 外部变量声明,修复编译错误 2026-07-16 18:28:53 +08:00
Antigravity IDE
31f5066052 fix(rf): 升级 EV1527 为完整 24 位统一寻址,彻底分清不同按键/型号配对报警的 Bug 2026-07-16 18:25:16 +08:00
Antigravity IDE
731115e09a docs: 为所有代码源文件添加详细中文注释,并在设计文档中纠正GPIO物理引脚映射表 2026-07-16 17:53:44 +08:00
Antigravity IDE
30a2e1680b Initialize repository and implement low-power sleep wakeup 2026-07-15 15:57:37 +08:00