12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include "iwag.h"
- void IWDG_Config(u8 prer,u16 rlr)
- {
- IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);//使能对IWDG->PR IWDG->RLR的写
-
- IWDG_SetPrescaler(prer); //设置IWDG分频系数
-
- IWDG_SetReload(rlr); //设置IWDG装载值
-
- IWDG_ReloadCounter(); //reload
-
- IWDG_Enable(); //使能看门狗
- }
- void IWDG_Feed(void)
- {
- IWDG_ReloadCounter();
- }
|