|
发表于 2024-7-10 10:01:40
|
显示全部楼层
WDT_InitTypeDef WDT_InitStructure;
// Configure the WDT to be enabled or disabled
WDT_InitStructure.WDT_Enable = ENABLE; // Interrupt enable ENABLE or DISABLE
// Configure the WDT to stop counting during CPU idle
WDT_InitStructure.WDT_IDLE_Mode = WDT_IDLE_STOP; // IDLE mode Indicates whether to stop counting WDT_IDLE_STOP,WDT_IDLE_RUN
// Set the clock division factor of the WDT, determining the timeout period
WDT_InitStructure.WDT_PS = WDT_SCALE_256; // Watchdog timer clock frequency division factor WDT_SCALE_2,WDT_SCALE_4,WDT_SCALE_8,WDT_SCALE_16,WDT_SCALE_32,WDT_SCALE_64,WDT_SCALE_128,WDT_SCALE_256
// Initialize the WDT with the configured parameters
WDT_Inilize(&WDT_InitStructure); // initialize
用的库函数开发,就一个分频系数改了,外界一个任务在定时跑喂狗 |
|