123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #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"
- #define PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVER_NUM 1
- #define PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVERFLOW 2
- 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;
- const char *name;
- #if ProcessTime_EN
- const char *name;
- uint32_t useTime;
- #endif
- }PROCESS_t;
- #if DEBUGLOG_ENABLE
- #define DEBUG_LOG(format,...) SEGGER_RTT_printf(0,format, ##__VA_ARGS__);
- #else
- #define DEBUG_LOG(format,...)
- #endif
- 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);
- void Process_All_Stop(void);
- #endif
|