NANO130_H2Press/User/wdt_reset.c

37 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
*********************************************************************************************************
* IAR Development Kits
* on the
*
* M451
*
* Filename : wdt_reset.c
* Version : V1.00
* Programmer(s) : Qian Xianghong
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INCLUDE FILES
*********************************************************************************************************
*/
#include "includes.h"
void Watchdog_Init()
{
// 设置看门狗时钟为PCLK0/2048休眠模式下时钟也停止
CLK_SetModuleClock(WDT_MODULE, 0, 0);
// 允许外设时钟
CLK_EnableModuleClock(WDT_MODULE);
}
void Watchdog_Open()
{
// 喂狗
WDT_RESET_COUNTER();
// 允许看门狗复位,禁止看门狗唤醒
WDT_Open(WDT_TIMEOUT_2POW18, WDT_RESET_DELAY_1026CLK, TRUE, FALSE);
}