int main(void) { ...... ......
/* Enable write access to IWDG_PR and IWDG_RLR registers */ IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);//写使能 /* IWDG counter clock: 32KHz(LSI) / 32 = 1KHz */ IWDG_SetPrescaler(IWDG_Prescaler_32); /* Set counter reload value to 349 */ IWDG_SetReload(349); /* Reload IWDG counter */ IWDG_ReloadCounter(); /* Enable IWDG (the LSI oscillator will be enabled by hardware) */ IWDG_Enable();//LSI时钟被强制打开
while(1) { ......
...... }
}
循环语句里面没有IWDG_ReloadCounter()来喂狗,为何不能溢出重启呢?
|