?? test_func.s
字號:
.module test_func.c
.area text(rom, con, rel)
.dbfile G:\編程2002-10-15-HOME\做過的項目\2002-10-22\home-c\software\ucos-ii-at90S-icc-avr\ucos-ii-source\test_func.c
.dbfunc e myOSTimeDly _myOSTimeDly fV
; p -> R22,R23
; ticks -> R20,R21
.even
_myOSTimeDly::
rcall push_gset2
mov R20,R16
mov R21,R17
.dbline -1
.dbline 4
; #include "includes.h"
;
; void myOSTimeDly (INT16U ticks)
; {
.dbline 6
; /*OSTCBCur*/
; OS_TCB *p=OSTCBCur;
lds R22,_OSTCBCur
lds R23,_OSTCBCur+1
.dbline 7
; if( ((OS_TCB*)0)==p)
cpi R22,0
cpc R22,R23
brne L4
X0:
.dbline 8
; {
.dbline 9
; ProgramError();
rcall _ProgramError
.dbline 10
; return;
rjmp L3
L4:
.dbline 12
; }
; OSTimeDly(ticks);
mov R16,R20
mov R17,R21
rcall _OSTimeDly
.dbline -2
.dbline 13
; }
L3:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r p 22 pX
.dbsym r ticks 20 i
.dbend
.dbfunc e Flash_Port _Flash_Port fV
; port_foot -> R22
; port_ -> R20
.even
_Flash_Port::
rcall push_gset2
mov R22,R18
mov R20,R16
.dbline -1
.dbline 18
;
; /* flash port*/
; void Flash_Port(unsigned char port_,
; unsigned char port_foot)
; {
.dbline 19
; OS_ENTER_CRITICAL();
st -y,r16
in r16,0x3f
cli
push r16
ld r16,y+
.dbline 19
.dbline 20
; if(PORT_TO_FLASH_B==port_)
tst R20
brne L7
.dbline 21
; {
.dbline 22
; DDRB = 0xff;
ldi R24,255
out 0x17,R24
.dbline 23
; PORTB = port_foot;
out 0x18,R22
.dbline 24
; }else
rjmp L8
L7:
.dbline 25
; {
.dbline 26
; DDRC = 0xff;
ldi R24,255
out 0x14,R24
.dbline 27
; PORTC = port_foot;
out 0x15,R22
.dbline 28
; }
L8:
.dbline 29
; OS_EXIT_CRITICAL();
st -y,r16
pop r16
out 0x3F,r16
ld r16,y+
.dbline 29
.dbline 30
; Delay(DELAY_COUNT);
ldi R16,10
ldi R17,0
rcall _Delay
.dbline 32
;
; OS_ENTER_CRITICAL();
st -y,r16
in r16,0x3f
cli
push r16
ld r16,y+
.dbline 32
.dbline 33
; if(PORT_TO_FLASH_B==port_)
tst R20
brne L9
.dbline 34
; {
.dbline 35
; DDRB = 0xff;
ldi R24,255
out 0x17,R24
.dbline 36
; PORTB = 0xff;
out 0x18,R24
.dbline 37
; }else
rjmp L10
L9:
.dbline 38
; {
.dbline 39
; DDRC = 0xff;
ldi R24,255
out 0x14,R24
.dbline 40
; PORTC = 0xff;
out 0x15,R24
.dbline 41
; }
L10:
.dbline 42
; OS_EXIT_CRITICAL();
st -y,r16
pop r16
out 0x3F,r16
ld r16,y+
.dbline 42
.dbline 43
; Delay(DELAY_COUNT);
ldi R16,10
ldi R17,0
rcall _Delay
.dbline -2
.dbline 44
; }
L6:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r port_foot 22 c
.dbsym r port_ 20 c
.dbend
.dbfunc e test_OSTickISR0 _test_OSTickISR0 fV
; b1 -> <dead>
.even
_test_OSTickISR0::
.dbline -1
.dbline 48
;
; /* test timer isr,flash PORT C 2*/
; void test_OSTickISR0()
; {
.dbline 51
; unsigned char b1;
; /*reset timer*/
; TCNT0 =256-(7372800/50/1024); /* ; Reload timer to overflow at a rate of 50Hz*/
ldi R24,112
out 0x32,R24
.dbline 53
; /*flash port A.2*/
; FLASH_PORT_B2();
ldi R18,251
clr R16
rcall _Flash_Port
.dbline 55
; /*enable global interrupt*/
; OS_EXIT_CRITICAL();
st -y,r16
pop r16
out 0x3F,r16
ld r16,y+
.dbline 55
.dbline -2
.dbline 56
; }
L11:
.dbline 0 ; func end
ret
.dbsym l b1 1 c
.dbend
.dbfunc e Delay _Delay fV
; i -> R20
; j -> R10
; k -> R12
; loop -> R22,R23
.even
_Delay::
rcall push_gset4
mov R22,R16
mov R23,R17
.dbline -1
.dbline 59
;
; void Delay(int loop)
; {
.dbline 63
; unsigned char i,j,k;
; /* myOSTimeDly(1);return;*/
; /* myOSTimeDly(OS_TICKS_PER_SEC); return;*/
; for(i=1;i<loop;i++)
ldi R20,1
rjmp L16
L13:
.dbline 64
; {
.dbline 65
; myOSTimeDly(1);
ldi R16,1
ldi R17,0
rcall _myOSTimeDly
.dbline 66
; for(j=1;j;j++)
clr R10
inc R10
rjmp L20
L17:
.dbline 67
; {
.dbline 68
; for(k=1;k;k++)
clr R12
inc R12
rjmp L24
L21:
.dbline 69
L22:
.dbline 68
inc R12
L24:
.dbline 68
tst R12
brne L21
.dbline 70
L18:
.dbline 66
inc R10
L20:
.dbline 66
tst R10
brne L17
.dbline 71
L14:
.dbline 63
inc R20
L16:
.dbline 63
mov R2,R20
clr R3
cp R2,R22
cpc R3,R23
brlt L13
.dbline -2
.dbline 72
; ;
; }
; }
; }
L12:
rcall pop_gset4
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r j 10 c
.dbsym r k 12 c
.dbsym r loop 22 I
.dbend
.dbfunc e Delay_Real _Delay_Real fV
; i -> R20
; j -> R22
; k -> R10
; loop -> R16,R17
.even
_Delay_Real::
rcall push_gset3
.dbline -1
.dbline 75
;
; void Delay_Real(int loop)
; {
.dbline 77
; unsigned char i,j,k;
; for(i=1;i<loop;i++)
ldi R20,1
rjmp L29
L26:
.dbline 78
; {
.dbline 79
; for(j=1;j;j++)
ldi R22,1
rjmp L33
L30:
.dbline 80
; {
.dbline 81
; for(k=1;k;k++)
clr R10
inc R10
rjmp L37
L34:
.dbline 82
L35:
.dbline 81
inc R10
L37:
.dbline 81
tst R10
brne L34
.dbline 83
L31:
.dbline 79
inc R22
L33:
.dbline 79
tst R22
brne L30
.dbline 84
L27:
.dbline 77
inc R20
L29:
.dbline 77
mov R2,R20
clr R3
cp R2,R16
cpc R3,R17
brlt L26
.dbline -2
.dbline 85
; ;
; }
; }
; }
L25:
rcall pop_gset3
.dbline 0 ; func end
ret
.dbsym r i 20 c
.dbsym r j 22 c
.dbsym r k 10 c
.dbsym r loop 16 I
.dbend
.dbfunc e Delay_error _Delay_error fV
; loop -> R20,R21
.even
_Delay_error::
rcall push_gset1
mov R20,R16
mov R21,R17
.dbline -1
.dbline 88
;
; void Delay_error(int loop)
; { Delay_Real(loop);}
.dbline 88
mov R16,R20
mov R17,R21
rcall _Delay_Real
.dbline -2
.dbline 88
L38:
rcall pop_gset1
.dbline 0 ; func end
ret
.dbsym r loop 20 I
.dbend
.dbfunc e ProgramRest _ProgramRest fV
; i -> R20,R21
; times -> R22,R23
.even
_ProgramRest::
rcall push_gset2
mov R22,R16
mov R23,R17
.dbline -1
.dbline 92
; /*when reset,called
; flash PORTA,PORTB,PORTC,PORTD */
; void ProgramRest(int times)
; {
.dbline 94
; int i;
; for(i=0;i<times;i++)
clr R20
clr R21
rjmp L43
L40:
.dbline 95
.dbline 96
ldi R24,255
out 0x1a,R24
.dbline 97
out 0x17,R24
.dbline 98
out 0x14,R24
.dbline 99
out 0x11,R24
.dbline 100
clr R2
out 0x1b,R2
.dbline 101
out 0x18,R2
.dbline 102
out 0x15,R2
.dbline 103
out 0x12,R2
.dbline 104
ldi R16,10
ldi R17,0
rcall _Delay_Real
.dbline 105
ldi R24,255
out 0x1b,R24
.dbline 106
out 0x18,R24
.dbline 107
out 0x15,R24
.dbline 108
out 0x12,R24
.dbline 109
ldi R16,10
ldi R17,0
rcall _Delay_Real
.dbline 110
L41:
.dbline 94
subi R20,255 ; offset = 1
sbci R21,255
L43:
.dbline 94
cp R20,R22
cpc R21,R23
brlt L40
.dbline -2
.dbline 111
; {
; DDRA = 0xff;
; DDRB = 0xff;
; DDRC = 0xff;
; DDRD = 0xff;
; PORTA=0;
; PORTB=0;
; PORTC=0;
; PORTD=0;
; Delay_Real(DELAY_COUNT_WHEN_RESET);
; PORTA=0xff;
; PORTB=0xff;
; PORTC=0xff;
; PORTD=0xff;
; Delay_Real(DELAY_COUNT_WHEN_RESET);
; }
; }
L39:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 I
.dbsym r times 22 I
.dbend
.dbfunc e ProgramError _ProgramError fV
.even
_ProgramError::
.dbline -1
.dbline 115
;
; /*when error,dead loop*/
; void ProgramError()
; {
rjmp L46
L45:
.dbline 117
ldi R16,1
ldi R17,0
rcall _ProgramError_Times
L46:
.dbline 116
rjmp L45
X1:
.dbline -2
.dbline 118
; while(1)
; ProgramError_Times(1);
; }
L44:
.dbline 0 ; func end
ret
.dbend
.dbfunc e ProgramError_Times _ProgramError_Times fV
; i -> R20,R21
; times -> R22,R23
.even
_ProgramError_Times::
rcall push_gset2
mov R22,R16
mov R23,R17
.dbline -1
.dbline 123
;
; /*when reset,called*/
; /*flash PORTA,PORTB*/
; void ProgramError_Times(int times)
; {
.dbline 125
; int i;
; OS_ENTER_CRITICAL();
st -y,r16
in r16,0x3f
cli
push r16
ld r16,y+
.dbline 125
.dbline 126
; for(i=0;i<times;i++)
clr R20
clr R21
rjmp L52
L49:
.dbline 127
.dbline 128
ldi R24,255
out 0x1a,R24
.dbline 129
out 0x17,R24
.dbline 130
clr R2
out 0x1b,R2
.dbline 131
out 0x18,R2
.dbline 132
ldi R16,10
ldi R17,0
rcall _Delay_error
.dbline 133
ldi R24,255
out 0x1a,R24
.dbline 134
out 0x17,R24
.dbline 135
out 0x1b,R24
.dbline 136
out 0x18,R24
.dbline 137
ldi R16,10
ldi R17,0
rcall _Delay_error
.dbline 138
L50:
.dbline 126
subi R20,255 ; offset = 1
sbci R21,255
L52:
.dbline 126
cp R20,R22
cpc R21,R23
brlt L49
.dbline 139
; {
; DDRA = 0xff;
; DDRB = 0xff;
; PORTA=0;
; PORTB=0;
; Delay_error(DELAY_COUNT);
; DDRA = 0xff;
; DDRB = 0xff;
; PORTA=0xff;
; PORTB=0xff;
; Delay_error(DELAY_COUNT);
; }
; OS_EXIT_CRITICAL();
st -y,r16
pop r16
out 0x3F,r16
ld r16,y+
.dbline 139
.dbline -2
.dbline 140
; }
L48:
rcall pop_gset2
.dbline 0 ; func end
ret
.dbsym r i 20 I
.dbsym r times 22 I
.dbend
.dbfunc e OSTaskSwHook _OSTaskSwHook fV
.even
_OSTaskSwHook::
.dbline -1
.dbline 161
;
; /*
; ********************************************************************************
; * TASK SWITCH HOOK
; *
; * Description:
; * This function is called when a task switch is performed. This allows you to
; * perform other operations during a context switch.
; *
; * Arguments: none
; *
; * Note(s):
; * 1) Interrupts are disabled during this call.
; * 2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB
; * of the task that will be 'switched in' (i.e. the highest priority task)
; * and, 'OSTCBCur' points to the task being switched out (i.e. the
; * preempted task).
; ********************************************************************************
; */
; void OSTaskSwHook (void)
; {
.dbline -2
.dbline 162
; }
L53:
.dbline 0 ; func end
ret
.dbend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -