39 lines
1.7 KiB
C
39 lines
1.7 KiB
C
|
#include "watchdog.h"
|
|||
|
#include "stm32f10x_iwdg.h"
|
|||
|
|
|||
|
/********************************************************************************
|
|||
|
* @file watchdog.c
|
|||
|
* @author <EFBFBD>̳ϿƼ<EFBFBD> Mr.Wang
|
|||
|
* @version V1.0.0
|
|||
|
* @date 11-Dec-2018
|
|||
|
* @brief <EFBFBD>ṩӲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ź<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
******************************************************************************
|
|||
|
* @<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD>
|
|||
|
* 1<EFBFBD><EFBFBD>STM32Ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ź<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
* 2<EFBFBD><EFBFBD>ι<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>
|
|||
|
*******************************************************************************/
|
|||
|
|
|||
|
/**************************************************************************************************
|
|||
|
* <EFBFBD><EFBFBD> <EFBFBD>ƣ<EFBFBD> void Watchdog_Init( void )
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>Ź<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
* ԭ<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD> STM32<EFBFBD>Դ<EFBFBD>Ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ź<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> void Watchdog_Feed( void )<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ι<EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܷ<EFBFBD>
|
|||
|
*************************************************************************************************/
|
|||
|
void Watchdog_Init( void )
|
|||
|
{
|
|||
|
// IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable);// ʹ<>ܶԼĴ<D4BC><C4B4><EFBFBD>IWDG_PR<50><52>IWDG_RLR<4C><52>д<EFBFBD><D0B4><EFBFBD><EFBFBD>*/
|
|||
|
// IWDG_SetPrescaler(IWDG_Prescaler_256); //<2F><><EFBFBD>Ź<EFBFBD>ʱ<EFBFBD>ӷ<EFBFBD>Ƶ,40K/256=156HZ(6.4ms)
|
|||
|
// IWDG_SetReload(781); //ι<><CEB9>ʱ<EFBFBD><CAB1> 5s/6.4MS=781 .ע<>ⲻ<EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>0xfff This parameter must be a number between 0 and 0x0FFF.
|
|||
|
// IWDG_ReloadCounter(); //<2F><>IWDG<44><47>װ<EFBFBD>ؼĴ<D8BC><C4B4><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>װ<EFBFBD><D7B0>IWDG<44><47><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// IWDG_Enable(); //ʹ<><CAB9>IWDG
|
|||
|
}
|
|||
|
|
|||
|
/**************************************************************************************************
|
|||
|
* <EFBFBD><EFBFBD> <EFBFBD>ƣ<EFBFBD> void Watchdog_Feed( void )
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ι<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*************************************************************************************************/
|
|||
|
void Watchdog_Feed( void )
|
|||
|
{
|
|||
|
// IWDG_ReloadCounter(); //reload<61><64><EFBFBD><EFBFBD>װ<EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
|