添加普冉 PY32F040 OTA 双工程代码生成模板

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 18:59:56 +08:00
co-authored by Cursor
commit 331864dc64
496 changed files with 329040 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef __IWDG_CONFIG_H
#define __IWDG_CONFIG_H
/**
* @file iwdg_config.h
* @brief IWDG 超时参数(APP / Bootloader 共用,换芯片时与 HAL 预分频一并调整)
*
* 当前:LSI ≈ 40 kHz,预分频 /16 → 计数 2.5 kHzReload = 2500 → 超时约 1 s。
*
* APP 侧使用 HALPrescaler = IWDG_PRESCALER_16Reload = IWDG_RELOAD_VALUE。
* Bootloader 跳转前使能 IWDGAPP 启动后须尽早 HAL_IWDG_Init / Refresh。
*
* 约束:IWDG 一旦启动,LSI 被硬件锁定,APP 时钟配置中不可写 LSI OFF。
*/
#define IWDG_RELOAD_VALUE 2500U
/* Bootloader 裸寄存器写 PR 时的值(= IWDG_PRESCALER_16 对应位域) */
#define IWDG_PR_REG 0x02U
#endif /* __IWDG_CONFIG_H */