123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef __system_h__
- #define __system_h__
- #include <stdbool.h>
- #include <stdint.h>
- #include <string.h>
- #include "sdk_common.h"
- #include "SEGGER_RTT.h"
- #include "usr_config.h"
- typedef void (*Sleep_cb)(uint32_t);
- typedef void (*PROCESS_cb)(void);
- typedef struct _PROCESS{
- uint8_t holdon;
- uint16_t Peroid;
- uint32_t tim;
- PROCESS_cb cb;
- uint8_t enable;
- #if ProcessTime_EN
- const char *name;
- uint32_t useTime;
- #endif
- }PROCESS_t;
- #define DEBUG_LOG(format,...) SEGGER_RTT_printf(0,format, ##__VA_ARGS__);
- int Sleep_Regist(Sleep_cb cb);
- int Wakeup_Regist(Sleep_cb cb);
- void Sleep_Event(void);
- int Process_Start(uint16_t peroid,const char *name,PROCESS_cb cb);
- void Process_Stop(PROCESS_cb cb);
- void Process_SetHoldOn(PROCESS_cb cb,uint8_t holdon);
- void Process_UpdatePeroid(PROCESS_cb cb,uint16_t Peroid);
- uint16_t Process_GetPeroid(PROCESS_cb cb);
- #endif
|