⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 ucosII在S12上的部分实现源代码
💻 H
字号:
//all the global defines should be in this .h file
//all the global variables should be defined in this .h file with EXT
//all the global function should be declared in this .h file

#define PORTB    (*((volatile unsigned char*)(0x0001)))     
#define DDRB     (*((volatile unsigned char*)(0x0003))) 
#define CRGINT   (*((volatile unsigned char*)(0x0038))) 
#define RTICTL   (*((volatile unsigned char*)(0x003B)))

#define Baud_9600  55
#define Baud_19200 26
#define SCI0CR2     (*((volatile unsigned char*)(0x00CB)))
#define SCI0SR1     (*((volatile unsigned char*)(0x00CC)))
#define SCI0BDH     (*((volatile unsigned char*)(0x00C8)))
#define SCI0BDL     (*((volatile unsigned char*)(0x00C9)))
#define SCI0DRL     (*((volatile unsigned char*)(0x00CF)))

#define TASK_STK_SIZE  200



typedef struct{
INT8U	PPAGE;
}TASKDATA;


/*******************************************/
	//global variables definition
/******************************************/

EXT OS_STK TaskStartStk[TASK_STK_SIZE];
EXT OS_STK Task1Stk[TASK_STK_SIZE];
EXT OS_STK Task2Stk[TASK_STK_SIZE];

EXT OS_EVENT *Semprintp;
EXT INT8U err;
EXT TASKDATA TaskStartData;
EXT TASKDATA Task1Data;
EXT TASKDATA Task2Data;

/************************************/
	//global functions declaration
	//their define is in Hardware.c or Userlib.c (except main)
/************************************/

//in Hardware.c
void uart_init(void);
void uart_putchar(unsigned char ch);
void HardwareInit(void);

//in Userlib.c
void delay(long j);
void printp(void (*PortToPut)(), char* ctrl, ...);

⌨️ 快捷键说明

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