cn_os_head.h

来自「一个小的嵌入式os」· C头文件 代码 · 共 68 行

H
68
字号
//==============================================
//			:Cn.oS[Operating System from China]
//filename	:	
//description	:
//			:
//			:
//			:
//author		:
//date		:
//==============================================
#ifndef	 _CN_OS_HEAD_H_
#define 	_CN_OS_HEAD_H_

#include "Cn_oS_cpu.h"


#define 	STACK_LENGTH	4096
#define   PCB_LENGTH		200
#define   TASK_NUMBER 	24



extern 	void Init_Timer5 (void);
extern 	void Init_Timer5_start (void);

extern 	int 	kaka;

extern 	void ENTER_CRITICAL(void);
extern	void  EXIT_CRITICAL(void);
extern 	void Save_Info(void);
extern 	void Cn_oS_Start(void);
extern	void Save_Info(void);
extern	void	Recover_Info(void);
extern	void	Switch_Task(void);
extern	void Task_Create(void   (*task)(void *pd),int task_id);

extern 	void TASK_SWITCH(void);
extern 	void ATTEMPER_first(void);
extern     void Cn_oS_Delay(int tick);


typedef  struct{
INT32UN 		TCB[PCB_LENGTH];//reserve
INT32UN 		PCB[PCB_LENGTH];//PCB									//ProcessesControlBlock(PCB)

INT32UN 	 	*Task_P;
INT32UN 		*Stack_P;
INT32UN 		Task_ID;
int    		Delay_tick;
INT32UN 	 	STACK[STACK_LENGTH];
} TINFO;

extern TINFO T_INFO[TASK_NUMBER];

#ifndef 	PCB_LENGTH		
#define 	PCB_LENGTH		20
#endif

#ifndef 	STACK_LENGTH
#define 	STACK_LENGTH	25000
#endif

#ifndef TASK_NUMBER
#error  "You must #define TASK_NUMBER in file:root.h"
#endif

#endif

⌨️ 快捷键说明

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