feat(DLD154V4B): V2.10 新增 IWDT 硬件看门狗(超时≈1.64s,双保险喂狗)

- 对齐 DLD154Pro V3.03 方案: TMR15 ISR 5ms 递增 g_wdg_counter,
  主循环 poll_wdg() 每 500ms 喂狗, 超时 16×4096/40k ≈ 1.64s
- 双保险: ISR 死→计数不涨→永不喂狗; 主循环死→poll_wdg 不执行→复位
- main() 使能后立即喂一次, 给 FreeRTOS 启动留足时间
- 隔离测试 5 项断言全过 (init 配置/10s 喂狗 20 次/ISR 死不喂/边界 99-100 tick)
- 文档同步: technical-spec(架构图+§13.1 机制) / release-notes(V2.10)
  / product-manual(特性+版本) / roadmap / devlog
This commit is contained in:
wangfq
2026-08-28 08:56:33 +08:00
parent 859842aba0
commit 8f43f8f1c9
8 changed files with 117 additions and 4 deletions
@@ -46,6 +46,15 @@
*===========================================================================*/
#define USE_FLATNESS_EXIT 0
/*===========================================================================
* 看门狗 (IWDT) - V2.10 新增
* 双保险模式: TMR15 ISR 5ms 递增 g_wdg_counter, 主循环 poll_wdg() 每 500ms 喂狗
* 超时 = WDT_DIV x (WDT_RLD+1) / LSI(约40kHz) 约 1.64s
*===========================================================================*/
#define WDT_COUNTER_LIMIT 100 // 喂狗周期 500ms (TMR15 5ms x 100)
#define WDT_DIV 16 // LSI 分频
#define WDT_RLD 4095 // 12bit 重装载 -> 超时约 1.64s
#define WINDOW_ORIGIN 500 // 基线跟踪窗口 (500 × 10ms = 5s)
/*===========================================================================
@@ -126,6 +135,7 @@ extern uint16_t Hold_CNT; // 有限存在计数器
extern uint8_t loop1_INCNT; // 进入延时计数
extern uint8_t loop1_OUTCNT; // 离开延时/脉冲宽度计数
extern uint8_t TM1cnt; // 50ms tick 分频计数
extern volatile uint16_t g_wdg_counter; // 看门狗活性计数 (TMR15 5ms 递增)
/*===========================================================================
* 拨码开关状态
@@ -183,5 +193,7 @@ void poll_yellow_led(void);
void poll_green_led(void);
void LEDA_ON_OFF(void);
void vd1_task(void);
void wdt_init(void);
void poll_wdg(void);
#endif /* __TASKLOOP_H__ */