104 lines
2.9 KiB
C
Raw Normal View History

2025-04-26 16:03:23 +08:00
/** ##########################################################################
** Filename :
** Project :
** Module :
** Processor :
** Version : 1.0
** Compiler :
** Date/Time :
** Abstract :
** Contents :
** Note :
**
** (c) Copyright dmdz Co.,Ltd
** --------------------------------------------------------------------------
** R E V I S I O N H I S T O R Y
** --------------------------------------------------------------------------
** Date Ver Author Description
** -20230602- --V1.0-- --mingyea--- ----
** #########################################################################*/
/*---------------------------------------------------------------------------
- I N C L U D E F I L E S
----------------------------------------------------------------------------*/
#include "wdog.h"
#include "logic_timer.h"
#include "gpio.h"
/*---------------------------------------------------------------------------
- D E F I N E S / M A C R O S
----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
- T Y P E D E F I N I T I O N S
----------------------------------------------------------------------------*/
typedef struct
{
u16 count[6];
}wdog_cfg_s;
/*---------------------------------------------------------------------------
- S T A T I C V A R I A B L E S
----------------------------------------------------------------------------*/
static wdog_cfg_s g_wdog_cfg ={0};
/*---------------------------------------------------------------------------
* G L O B A L V A R I A B L E S
----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
- C O N S T A N T S
----------------------------------------------------------------------------*/
#if WDT_OPERATION_MODE == WDT_OPERATION_NORMAL
/*! watchdog1 configuration structures */
const FL_IWDT_InitTypeDef g_IWDT_InitStruct =
{
FL_IWDT_PERIOD_250MS, /* 最长溢出时间 */
0u, /* 默认不使用窗口 */
};
#elif WDT_OPERATION_MODE == WDT_OPERATION_WINDOWS
/*! watchdog1 configuration structures */
const FL_WWDT_InitTypeDef g_WWDT_InitStruct =
{
FL_WWDT_PERIOD_1024CNT, /* 最长溢出时间 */
};
#endif
/*---------------------------------------------------------------------------
- F U N C T I O N P R O T O T Y P E
----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
|Prototype :
|Called by :
|Preconditions :
|Input parameters :
|Output parameters :
|Return value :
|Description :
----------------------------------------------------------------------------*/
void wdog_irq_callback(void *device, uint32_t wpara, uint32_t lpara)
{
g_wdog_cfg.count[0]++;
}
/*end line*/