You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
555 B

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "zlog.h"
//extern taskfuction m_taskfunc;
typedef void (*taskfuction)();
//typedef void (*taskfuction)(taskfuction);
//状态机
typedef enum{
idle,
working,
end,
} status_t;
typedef struct{
uint32_t TaskNotify;//任务通知信号量
status_t m_status;
bool m_tasktransition;
void (*m_taskfunc)();
void (*init)(taskfuction);
void (*start)(taskfuction);
}Task_t;//任务结构体
void Task_init(Task_t* task);
void Task_start(taskfuction cb, Task_t* task);