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().
This commit is contained in:
edisondeng
2026-07-31 16:39:06 +08:00
parent 29194a4f5d
commit 4a89aef71e
5 changed files with 270 additions and 155 deletions

View File

@@ -390,9 +390,8 @@ void Wakeup_Restore(void)
P0INTE = 0x00;
P2INTE = 0x00;
P3INTE = 0x40;
// 恢复休眠前被 Enter_Low_Power_Sleep() 关闭的 P3.6 内部上拉LR690L 在 SHUT=1 期间数据脚
// 高阻悬空,配合常态开启的 P3.6 中断会引发中断风暴,唤醒后必须立刻用上拉钳住电平
P3PU |= 0x40;
// P3.6 的悬空钳位已改用内部下拉 (P3PD在 RF_Init() 里一次性永久开启Power Down 期间
// SFR 状态保持不变,无需在这里重新配置);此处不再恢复上拉,避免上拉与下拉同时使能相互打架
P0WKUE = 0x00;
P2WKUE = 0x00;