1234567891011121314151617181920212223242526272829303132333435363738 |
- #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 (*PROCESS_cb)(void);
- typedef struct _PROCESS{ //进程结构体
- uint8_t holdon; //进程是否可进入低功耗模式
- uint16_t peroid; //进程周期
- uint32_t tim; //进程时间搓
- PROCESS_cb cb; //进程函数
- uint8_t enable; //进程运行标志位
- char* name; //进程名字
- uint32_t useTime; //进程消耗的时间
- }PROCESS_t;
- typedef void (*TIME_callback)(void*);
- void Time_Init(void);
- uint32_t Time_GetTicks(void);
- void Time_Regist(TIME_callback cb);
- void Time_UnRegist(TIME_callback cb);
- uint32_t rtc_sleep(uint8_t is_wearshoes);
- int Process_Start(uint32_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);
- #endif
|