12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef TASK_H_
- #define TASK_H_
- #include "sys.h"
- //define the task scheduler base type
- typedef struct {
- s8 (*handler)(void *pdata);
- void *pdata;
- }task;
- /******************************************************************************
- * FunctionName : new_task
- * Description : new a empty task
- * Parameters : none
- * Returns : the created task
- *******************************************************************************/
- task* new_task(void);
- /******************************************************************************
- * FunctionName : add_task
- * Description : add a new task to the system
- * Parameters : the task to be added
- * Returns : the add operation result
- *******************************************************************************/
- s8 add_task(task *ptask);
- /******************************************************************************
- * FunctionName : pop_task
- * Description : pop a task from the system
- * Parameters : none
- * Returns : the task
- *******************************************************************************/
- task* pop_task(void);
- /******************************************************************************
- * FunctionName : delete_task
- * Description : delete a task
- * Parameters : the task to be deleted
- * Returns : none
- *******************************************************************************/
- void delete_task(task *ptask);
- #endif
|