1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #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; //进程运行标志位
- #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); //app进程开始
- void Process_Stop(PROCESS_cb cb); //app进程停止
- void Process_SetHoldOn(PROCESS_cb cb,uint8_t holdon); //app进程是否可进入低功耗模式
- void Process_UpdatePeroid(PROCESS_cb cb,uint16_t Peroid);
- uint16_t Process_GetPeroid(PROCESS_cb cb);
- void Process_All_Stop(void);
- #endif
|