task.h

来自「一个简单的多任务调度器源码.可在Dos/windows下运行.」· C头文件 代码 · 共 37 行

H
37
字号
/************ tasK.h *******************************************************
 This file is created by Peng.Wang 06/20/2006
 
 Multitasking routine 
***************************************************************************/
#ifndef TASK_H
#define TASK_H


#include<type.h>


/***************************************************************************

The task data structure

***************************************************************************/
typedef void (*TASKENTRY)(void);

typedef struct
{
  Int8 Name[16];
  Int16 Priority;
  Int16 * Stack_top;
  Int32 Stack_size;
  TASKENTRY Task_entry;
}Tcb;
/*for the only one mcu system ,we can realize the mutex by switch on /off interrupt*/
#define  M_ENTER_CRITICAL()  asm  CLI          /*turn off the interrupt*/
#define  M_EXIT_CRITICAL()   asm  STI          /* turn on the interrupt*/

extern void T_main(void);
extern  Tcb* T_get_ready_task(void);
     

#endif /*TASK_H*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?