📄 ucos_ii.lst
字号:
9 =2 /* BYTE Registers */
10 =2 sfr P0 = 0x80;
11 =2 sfr P1 = 0x90;
12 =2 sfr P2 = 0xA0;
13 =2 sfr P3 = 0xB0;
14 =2 sfr PSW = 0xD0;
15 =2 sfr ACC = 0xE0;
16 =2 sfr B = 0xF0;
17 =2 sfr SP = 0x81;
18 =2 sfr DPL = 0x82;
19 =2 sfr DPH = 0x83;
20 =2 sfr PCON = 0x87;
21 =2 sfr TCON = 0x88;
22 =2 sfr TMOD = 0x89;
23 =2 sfr TL0 = 0x8A;
24 =2 sfr TL1 = 0x8B;
25 =2 sfr TH0 = 0x8C;
26 =2 sfr TH1 = 0x8D;
27 =2 sfr IE = 0xA8;
28 =2 sfr IP = 0xB8;
C51 COMPILER V7.01 UCOS_II 01/09/2003 18:37:27 PAGE 16
29 =2 sfr SCON = 0x98;
30 =2 sfr SBUF = 0x99;
31 =2
32 =2 /* 8052 Extensions */
33 =2 sfr T2CON = 0xC8;
34 =2 sfr RCAP2L = 0xCA;
35 =2 sfr RCAP2H = 0xCB;
36 =2 sfr TL2 = 0xCC;
37 =2 sfr TH2 = 0xCD;
38 =2
39 =2
40 =2 /* BIT Registers */
41 =2 /* PSW */
42 =2 sbit CY = PSW^7;
43 =2 sbit AC = PSW^6;
44 =2 sbit F0 = PSW^5;
45 =2 sbit RS1 = PSW^4;
46 =2 sbit RS0 = PSW^3;
47 =2 sbit OV = PSW^2;
48 =2 sbit P = PSW^0; //8052 only
49 =2
50 =2 /* TCON */
51 =2 sbit TF1 = TCON^7;
52 =2 sbit TR1 = TCON^6;
53 =2 sbit TF0 = TCON^5;
54 =2 sbit TR0 = TCON^4;
55 =2 sbit IE1 = TCON^3;
56 =2 sbit IT1 = TCON^2;
57 =2 sbit IE0 = TCON^1;
58 =2 sbit IT0 = TCON^0;
59 =2
60 =2 /* IE */
61 =2 sbit EA = IE^7;
62 =2 sbit ET2 = IE^5; //8052 only
63 =2 sbit ES = IE^4;
64 =2 sbit ET1 = IE^3;
65 =2 sbit EX1 = IE^2;
66 =2 sbit ET0 = IE^1;
67 =2 sbit EX0 = IE^0;
68 =2
69 =2 /* IP */
70 =2 sbit PT2 = IP^5;
71 =2 sbit PS = IP^4;
72 =2 sbit PT1 = IP^3;
73 =2 sbit PX1 = IP^2;
74 =2 sbit PT0 = IP^1;
75 =2 sbit PX0 = IP^0;
76 =2
77 =2 /* P3 */
78 =2 sbit RD = P3^7;
79 =2 sbit WR = P3^6;
80 =2 sbit T1 = P3^5;
81 =2 sbit T0 = P3^4;
82 =2 sbit INT1 = P3^3;
83 =2 sbit INT0 = P3^2;
84 =2 sbit TXD = P3^1;
85 =2 sbit RXD = P3^0;
86 =2
87 =2 /* SCON */
88 =2 sbit SM0 = SCON^7;
89 =2 sbit SM1 = SCON^6;
90 =2 sbit SM2 = SCON^5;
C51 COMPILER V7.01 UCOS_II 01/09/2003 18:37:27 PAGE 17
91 =2 sbit REN = SCON^4;
92 =2 sbit TB8 = SCON^3;
93 =2 sbit RB8 = SCON^2;
94 =2 sbit TI = SCON^1;
95 =2 sbit RI = SCON^0;
96 =2
97 =2 /* P1 */
98 =2 sbit T2EX = P1^1; // 8052 only
99 =2 sbit T2 = P1^0; // 8052 only
100 =2
101 =2 /* T2CON */
102 =2 sbit TF2 = T2CON^7;
103 =2 sbit EXF2 = T2CON^6;
104 =2 sbit RCLK = T2CON^5;
105 =2 sbit TCLK = T2CON^4;
106 =2 sbit EXEN2 = T2CON^3;
107 =2 sbit TR2 = T2CON^2;
108 =2 sbit C_T2 = T2CON^1;
109 =2 sbit CP_RL2 = T2CON^0;
30 =1
31 =1 //用户头文件加在最后面
32 =1 //Your head file add here.
18
19
20 #define OS_MASTER_FILE /* Prevent the following files from including includes.h */
21 #include <os_core.c>
1 =1 /*
2 =1 *********************************************************************************************************
3 =1 * uC/OS-II
4 =1 * The Real-Time Kernel
5 =1 * CORE FUNCTIONS
6 =1 *
7 =1 * (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
8 =1 * All Rights Reserved
9 =1 *
10 =1 * V2.00
11 =1 *
12 =1 * File : OS_CORE.C
13 =1 * By : Jean J. Labrosse
14 =1 *********************************************************************************************************
15 =1 */
16 =1
17 =1 #ifndef OS_MASTER_FILE
=1 #define OS_GLOBALS
=1 #include "includes.h"
=1 #endif
21 =1
22 =1 /*
23 =1 *********************************************************************************************************
24 =1 * LOCAL GLOBAL VARIABLES
25 =1 *********************************************************************************************************
26 =1 */
27 =1
28 =1 static INT8U OSIntExitY; /* Variable used by 'OSIntExit' to prevent using locals */
29 =1
30 =1 static OS_STK OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE]; /* Idle task stack */
31 =1
32 =1 #if OS_TASK_STAT_EN
=1 static OS_STK OSTaskStatStk[OS_TASK_STAT_STK_SIZE]; /* Statistics task stack */
=1 #endif
35 =1
36 =1 static OS_TCB OSTCBTbl[OS_MAX_TASKS + OS_N_SYS_TASKS]; /* Table of TCBs */
C51 COMPILER V7.01 UCOS_II 01/09/2003 18:37:27 PAGE 18
37 =1
38 =1 /*$PAGE*/
39 =1 /*
40 =1 *********************************************************************************************************
41 =1 * MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
42 =1 *
43 =1 * Note: Index into table is desired bit position, 0..7
44 =1 * Indexed value corresponds to bit mask
45 =1 *********************************************************************************************************
46 =1 */
47 =1
48 =1 INT8U const OSMapTbl[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
49 =1
50 =1 /*
51 =1 *********************************************************************************************************
52 =1 * PRIORITY RESOLUTION TABLE
53 =1 *
54 =1 * Note: Index into table is bit pattern to resolve highest priority
55 =1 * Indexed value corresponds to highest priority bit position (i.e. 0..7)
56 =1 *********************************************************************************************************
57 =1 */
58 =1
59 =1 INT8U const OSUnMapTbl[] = {
60 =1 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
61 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
62 =1 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
63 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
64 =1 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
65 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
66 =1 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
67 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
68 =1 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
69 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
70 =1 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
71 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
72 =1 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
73 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
74 =1 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
75 =1 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
76 =1 };
77 =1
78 =1 /*$PAGE*/
79 =1 /*
80 =1 *********************************************************************************************************
81 =1 * MAKE TASK READY TO RUN BASED ON EVENT OCCURING
82 =1 *
83 =1 * Description: This function is called by other uC/OS-II services and is used to ready a task that was
84 =1 * waiting for an event to occur.
85 =1 *
86 =1 * Arguments : pevent is a pointer to the event control block corresponding to the event.
87 =1 *
88 =1 * msg is a pointer to a message. This pointer is used by message oriented services
89 =1 * such as MAILBOXEs and QUEUEs. The pointer is not used when called by other
90 =1 * service functions.
91 =1 *
92 =1 * msk is a mask that is used to clear the status byte of the TCB. For example,
93 =1 * OSSemPost() will pass OS_STAT_SEM, OSMboxPost() will pass OS_STAT_MBOX etc.
94 =1 *
95 =1 * Returns : none
96 =1 *
97 =1 * Note : This function is INTERNAL to uC/OS-II and your application should not call it.
98 =1 *********************************************************************************************************
C51 COMPILER V7.01 UCOS_II 01/09/2003 18:37:27 PAGE 19
99 =1 */
100 =1 #if (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_MBOX_EN || OS_SEM_EN
101 =1 void OSEventTaskRdy (OS_EVENT *pevent, void *msg, INT8U msk)
102 =1 {
103 1 =1 OS_TCB *ptcb;
104 1 =1 INT8U x;
105 1 =1 INT8U y;
106 1 =1 INT8U bitx;
107 1 =1 INT8U bity;
108 1 =1 INT8U prio;
109 1 =1
110 1 =1
111 1 =1 y = OSUnMapTbl[pevent->OSEventGrp]; /* Find highest prio. task waiting for message */
112 1 =1 bity = OSMapTbl[y];
113 1 =1 x = OSUnMapTbl[pevent->OSEventTbl[y]];
114 1 =1 bitx = OSMapTbl[x];
115 1 =1 prio = (INT8U)((y << 3) + x); /* Find priority of task getting the msg */
116 1 =1 if ((pevent->OSEventTbl[y] &= ~bitx) == 0) { /* Remove this task f
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -