151 lines
3.1 KiB
C
151 lines
3.1 KiB
C
|
|
/*************************************CopyRight(c)************************************************
|
|
** 江西吕布科技有限公司
|
|
** www.lvbu.wang
|
|
**************************************************************************************************
|
|
**Filename:
|
|
**Version:
|
|
**Author:
|
|
**Date:
|
|
**Description:
|
|
**
|
|
**************************************************************************************************
|
|
**Version:
|
|
**Modifier:
|
|
**Datemodified:
|
|
**Description:
|
|
**
|
|
**************************************************************************************************/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/*********************************************************************
|
|
* Include
|
|
*/
|
|
#include "calender.h"
|
|
#include "softtimer.h"
|
|
#include "DebugLog.h"
|
|
/*********************************************************************
|
|
* Macros
|
|
*/
|
|
#define _TIMER_HANDLER_C_
|
|
/*********************************************************************
|
|
* Constants
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Typedefs
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Global Variables
|
|
*/
|
|
|
|
struct SYD_sysTimer syd_sysTimer[EVT_NUM] = {0};
|
|
/*********************************************************************
|
|
* Global Functions
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* External Variables
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* External Functions
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Local Vriables
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Local Functions
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Function : 两秒的定时事件
|
|
* Param in : none
|
|
* Param out: none
|
|
* Return : none
|
|
* Describe :
|
|
*/
|
|
#ifdef EVT_2S
|
|
void Timer_Evt_2s(void)
|
|
{
|
|
TIMER_EVT|=EVT_2S;
|
|
}
|
|
#endif
|
|
|
|
#ifdef EVT_1S_OTA
|
|
void Timer_EVT_1S_OTA(void)
|
|
{
|
|
TIMER_EVT|=EVT_1S_OTA;
|
|
}
|
|
#endif
|
|
|
|
#ifdef EVT_1S_WORK
|
|
void Timer_EVT_1S_WORK(void)
|
|
{
|
|
TIMER_EVT|=EVT_1S_WORK;
|
|
}
|
|
#endif
|
|
|
|
#ifdef EVT_100MS_PACK
|
|
void Timer_EVT_100MS_PCAK(void)
|
|
{
|
|
TIMER_EVT|=EVT_100MS_PACK;
|
|
}
|
|
#endif
|
|
|
|
#ifdef EVT_20S_BATTERY
|
|
void Timer_EVT_20S_BATTERY(void)
|
|
{
|
|
TIMER_EVT|=EVT_20S_BATTERY;
|
|
}
|
|
#endif
|
|
|
|
void Timer_Evt_List(void)
|
|
{
|
|
/* 2s的连接事务处理*/
|
|
#ifdef EVT_2S
|
|
Timer_Evt_Creat(EVT_2S,2000,Timer_Evt_2s,EVT_DISABLE_MODE);
|
|
#endif
|
|
|
|
/* 1s中OTA的事件处理*/
|
|
#ifdef EVT_1S_OTA
|
|
Timer_Evt_Creat(EVT_1S_OTA,1000,Timer_EVT_1S_OTA,EVT_DISABLE_MODE);
|
|
|
|
#endif
|
|
|
|
/* 1S的app工作任务*/
|
|
#ifdef EVT_1S_WORK
|
|
Timer_Evt_Creat(EVT_1S_WORK,1000,Timer_EVT_1S_WORK,EVT_DISABLE_MODE);
|
|
#endif
|
|
|
|
/* 300ms的打包数据发布*/
|
|
#ifdef EVT_100MS_PACK
|
|
Timer_Evt_Creat(EVT_100MS_PACK,100,Timer_EVT_100MS_PCAK,EVT_DISABLE_MODE);
|
|
#endif
|
|
|
|
/* 20S的定时获取电池电量*/
|
|
#ifdef EVT_20S_BATTERY
|
|
Timer_Evt_Creat(EVT_20S_BATTERY,20000,Timer_EVT_20S_BATTERY,EVT_DISABLE_MODE);
|
|
#endif
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|