📄 task.s
字号:
xjmp L50
L49:
.dbline 170
; else if(bKey_Status == cTOGGLE_Status)
lds R24,L31
cpi R24,2
brne L51
.dbline 171
; {
.dbline 172
; bKey_Status = cOFF_Status;
clr R2
sts L31,R2
.dbline 173
; }
L51:
L50:
.dbline 174
; }
L47:
.dbline 175
L33:
.dbline 134
xjmp L32
X3:
.dbline -2
.dbline 176
; }
; }
L30:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r wTask_Event 20 i
.dbend
.area data(ram, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
L54:
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
.area text(rom, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
.dbfunc e Task3 _Task3 fV
.dbsym s bKey_Status L54 c
; wTask_Event -> R20,R21
.even
_Task3::
xcall push_gset1
.dbline -1
.dbline 185
;
; //******************************************************************************
; // Function : Task3
; // Input : none
; // Output : none
; // Description : Task3 process,Control LED3
; //******************************************************************************
; void Task3(void)
; {
xjmp L56
L55:
.dbline 189
; INT16U wTask_Event;
; static INT8U bKey_Status = cOFF_Status;
; while(1)
; {
.dbline 191
; //task switch
; if(OS_Task_Switch(cPrioTask3) == true)
ldi R16,2
xcall _OS_Task_Switch
cpi R16,1
ldi R30,0
cpc R17,R30
brne L58
.dbline 192
; {
.dbline 193
; return;
xjmp L53
L58:
.dbline 196
; }
; //get event
; wTask_Event = OS_Event_Pend(cPrioTask3);
ldi R16,2
xcall _OS_Event_Pend
movw R20,R16
.dbline 198
; //event parsing : timer event
; if(wTask_Event & (1 << eTask3_Timer))
sbrs R16,0
rjmp L60
.dbline 199
; {
.dbline 200
; if(bKey_Status == cOFF_Status)
lds R2,L54
tst R2
brne L62
.dbline 201
; {
.dbline 202
; LED_OFF(cLED3);
ldi R16,6
xcall _LED_OFF
.dbline 203
; }
xjmp L63
L62:
.dbline 204
; else if(bKey_Status == cON_Status)
lds R24,L54
cpi R24,1
brne L64
.dbline 205
; {
.dbline 206
; LED_ON(cLED3);
ldi R16,6
xcall _LED_ON
.dbline 207
; }
xjmp L65
L64:
.dbline 208
; else if(bKey_Status == cTOGGLE_Status)
lds R24,L54
cpi R24,2
brne L66
.dbline 209
; {
.dbline 210
; LED_TOGGLE(cLED3);
ldi R16,6
xcall _LED_TOGGLE
.dbline 211
; }
L66:
L65:
L63:
.dbline 212
; }
L60:
.dbline 214
; //event parsing : key event
; if(wTask_Event & (1 << eTask3_Key))
sbrs R20,1
rjmp L68
.dbline 215
; {
.dbline 216
; if(bKey_Status == cOFF_Status)
lds R2,L54
tst R2
brne L70
.dbline 217
; {
.dbline 218
; bKey_Status = cTOGGLE_Status;
ldi R24,2
sts L54,R24
.dbline 219
; }
xjmp L71
L70:
.dbline 220
; else if(bKey_Status == cTOGGLE_Status)
lds R24,L54
cpi R24,2
brne L72
.dbline 221
; {
.dbline 222
; bKey_Status = cOFF_Status;
clr R2
sts L54,R2
.dbline 223
; }
L72:
L71:
.dbline 224
; }
L68:
.dbline 225
L56:
.dbline 188
xjmp L55
X4:
.dbline -2
.dbline 226
; }
; }
L53:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r wTask_Event 20 i
.dbend
.area data(ram, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
L75:
.blkb 1
.area idata
.byte 0
.area data(ram, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
.area text(rom, con, rel)
.dbfile E:\Steaven2000\AVR\AVR_Book\PROGRA~1\SOURCE~1\Code\多任务模拟系统设计\Task.c
.dbfunc e Task4 _Task4 fV
.dbsym s bKey_Status L75 c
; wTask_Event -> R20,R21
.even
_Task4::
xcall push_gset1
.dbline -1
.dbline 235
;
; //******************************************************************************
; // Function : Task4
; // Input : none
; // Output : none
; // Description : Task4 process,Control LED4
; //******************************************************************************
; void Task4(void)
; {
xjmp L77
L76:
.dbline 239
; INT16U wTask_Event;
; static INT8U bKey_Status = cOFF_Status;
; while(1)
; {
.dbline 241
; //task switch
; if(OS_Task_Switch(cPrioTask4) == true)
ldi R16,3
xcall _OS_Task_Switch
cpi R16,1
ldi R30,0
cpc R17,R30
brne L79
.dbline 242
; {
.dbline 243
; return;
xjmp L74
L79:
.dbline 246
; }
; //get event
; wTask_Event = OS_Event_Pend(cPrioTask4);
ldi R16,3
xcall _OS_Event_Pend
movw R20,R16
.dbline 248
; //event check
; if(wTask_Event == 0)
cpi R16,0
cpc R16,R17
brne L81
X5:
.dbline 249
; {
.dbline 250
; return;
xjmp L74
L81:
.dbline 253
; }
; //event parsing : timer event
; if(wTask_Event & (1 << eTask4_Timer))
sbrs R20,0
rjmp L83
.dbline 254
; {
.dbline 255
; if(bKey_Status == cOFF_Status)
lds R2,L75
tst R2
brne L85
.dbline 256
; {
.dbline 257
; LED_OFF(cLED4);
ldi R16,7
xcall _LED_OFF
.dbline 258
; }
xjmp L86
L85:
.dbline 259
; else if(bKey_Status == cON_Status)
lds R24,L75
cpi R24,1
brne L87
.dbline 260
; {
.dbline 261
; LED_ON(cLED4);
ldi R16,7
xcall _LED_ON
.dbline 262
; }
xjmp L88
L87:
.dbline 263
; else if(bKey_Status == cTOGGLE_Status)
lds R24,L75
cpi R24,2
brne L89
.dbline 264
; {
.dbline 265
; LED_TOGGLE(cLED4);
ldi R16,7
xcall _LED_TOGGLE
.dbline 266
; }
L89:
L88:
L86:
.dbline 267
; }
L83:
.dbline 269
; //event parsing : key event
; if(wTask_Event & (1 << eTask4_Key))
sbrs R20,1
rjmp L91
.dbline 270
; {
.dbline 271
; if(bKey_Status == cOFF_Status)
lds R2,L75
tst R2
brne L93
.dbline 272
; {
.dbline 273
; bKey_Status = cTOGGLE_Status;
ldi R24,2
sts L75,R24
.dbline 274
; }
xjmp L94
L93:
.dbline 275
; else if(bKey_Status == cTOGGLE_Status)
lds R24,L75
cpi R24,2
brne L95
.dbline 276
; {
.dbline 277
; bKey_Status = cOFF_Status;
clr R2
sts L75,R2
.dbline 278
; }
L95:
L94:
.dbline 279
; }
L91:
.dbline 280
L77:
.dbline 238
xjmp L76
X6:
.dbline -2
.dbline 281
; }
; }
L74:
xcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r wTask_Event 20 i
.dbend
.dbfunc e Task_Start _Task_Start fV
.even
_Task_Start::
.dbline -1
.dbline 290
;
; //******************************************************************************
; // Function : Task_Start
; // Input : none
; // Output : none
; // Description : Standard function format,put all tasks into while(1)
; //******************************************************************************
; void Task_Start(void)
; {
xjmp L99
L98:
.dbline 292
.dbline 293
xcall _Task1
.dbline 294
xcall _Task2
.dbline 295
xcall _Task3
.dbline 296
xcall _Task4
.dbline 297
L99:
.dbline 291
xjmp L98
X7:
.dbline -2
.dbline 298
; while(1)
; {
; Task1();
; Task2();
; Task3();
; Task4();
; }
; }
L97:
.dbline 0 ; func end
ret
.dbend
.dbfunc e Task_Init _Task_Init fV
.even
_Task_Init::
.dbline -1
.dbline 307
;
; //******************************************************************************
; // Function : Task_Init
; // Input : none
; // Output : none
; // Description : Standard function format,put all tasks Initialization here
; //******************************************************************************
; void Task_Init(void)
; {
.dbline 308
; Task1_Init();
xcall _Task1_Init
.dbline 309
; Task2_Init();
xcall _Task2_Init
.dbline 310
; Task3_Init();
xcall _Task3_Init
.dbline 311
; Task4_Init();
.dbline -2
.dbline 312
; }
L101:
.dbline 0 ; func end
xjmp _Task4_Init
.dbend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -