標(biāo)題:
stm32f407看門狗程序
[打印本頁]
作者:
Crazy·
時(shí)間:
2020-5-14 17:19
標(biāo)題:
stm32f407看門狗程序
小菜鳥新學(xué)的獨(dú)立看門狗知識(shí),望大神指點(diǎn),共進(jìn)步:
void wdg_init(int ms); //初始化
void wdg_fooddog(void); //喂狗
void wdg_init(int ms){
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); //關(guān)閉寫保護(hù)
IWDG_SetPrescaler(IWDG_Prescaler_32); //32分頻
IWDG_SetReload(ms); //重載值
IWDG_ReloadCounter(); //寫入
IWDG_Enable();//開啟
}
void wdg_fooddog(void){
IWDG_ReloadCounter(); //重載值
}
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1