喂狗void WDOG_Feed(void)
{
WDOG_REFRESH = 0xA602;
WDOG_REFRESH = 0xB480; //喂狗
}
关闭和开启看门狗void WDOG_Close(void)
{
WDOG_UNLOCK = 0xC520u;
WDOG_UNLOCK = 0xD928u;
WDOG_STCTRLH &= ~0x0001; //关闭看门狗 WDOTEN 0
}
void WDOG_Open(void)
{
WDOG_UNLOCK = 0xC520;
WDOG_UNLOCK = 0xD928;
WDOG_STCTRLH |= 0x0001; //打开看门狗 WDOTEN 1
}
|