?? function.s
字號:
.module function.c
.area text(rom, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
_addr_led7::
.blkb 2
.area idata
.word 8448
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.word 10496
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.word 9472
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.word 11520
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.word 8960
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.word 11008
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.dbsym e addr_led7 _addr_led7 A[12:6]i
_led7_data::
.blkb 2
.area idata
.byte 192,249
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 164,176
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 153,146
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 130,248
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 128,144
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 134,136
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 255,200
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 142,134
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 175,163
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.dbsym e led7_data _led7_data A[18:18]c
_key::
.blkb 2
.area idata
.byte 165,165
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 165,165
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 165,165
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.blkb 2
.area idata
.byte 165,165
.area data(ram, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.dbsym e key _key A[8:8]c
.area text(rom, con, rel)
.dbfile D:\報警系統設計資料\報警系統軟件\測量模塊基于CAN的系統網程序\報警燈板CAN網\function.c
.dbfunc e current_jisuan _current_jisuan fi
; tt -> R10,R11
; temp -> y+8
; result -> y+4
; k0 -> y+0
; current -> y+28
; fullscal -> y+24
.even
_current_jisuan::
xcall push_arg4
xcall push_gset4
sbiw R28,16
.dbline -1
.dbline 17
; #include "main.h"
;
;
; unsigned int addr_led7[6] = {0x2100,0x2900,0x2500,0x2d00,0x2300,0x2b00};
; unsigned char led7_data[18]= {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x86,0x88,0xff,0xc8,0x8e,0x86,0xaf,0xa3};
; SHD_LED pannel_led[48];
; unsigned char key[8]={0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xa5,0xa5};
; extern unsigned char mode_flag ;
; extern unsigned char T1,channel;
; extern VCI_CAN_OBJ rece_data[20],sendmsg;
; extern unsigned char soundoff[48];
; unsigned char out_state;
; VCI_CAN_OBJ sendmsg;
; extern long id4;
;
; unsigned int current_jisuan(float fullscal,unsigned int current)
; {
.dbline 20
; float result,temp,k0;
; unsigned int tt;
; CLI();
cli
.dbline 21
; WDR();
wdr
.dbline 22
; temp = (float)(current/100.0); //電流測量值計算
ldi R16,<L2
ldi R17,>L2
xcall lpm32
movw R2,R16
movw R4,R18
ldd R16,y+28
ldd R17,y+29
lsr R17
ror R16
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpmule2
movw R2,R16
movw R4,R18
ldd R16,y+28
ldd R17,y+29
andi R16,1
andi R17,0
xcall int2fp
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpadd2
movw R2,R16
movw R4,R18
ldi R16,<L3
ldi R17,>L3
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpdiv2
std y+8,R16
std y+9,R17
std y+10,R18
std y+11,R19
.dbline 24
;
; k0 = fullscal/16.0; //斜率計算
ldd R2,y+24
ldd R3,y+25
ldd R4,y+26
ldd R5,y+27
ldi R16,<L4
ldi R17,>L4
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpdiv2
std y+0,R16
std y+1,R17
std y+2,R18
std y+3,R19
.dbline 26
;
; result = k0*temp -4*k0; //顯示值計算
ldd R16,y+0
ldd R17,y+1
ldd R18,y+2
ldd R19,y+3
movw R24,R28
adiw R24,8
st -y,R25
st -y,R24
xcall fpmule1
movw R2,R16
movw R4,R18
ldi R16,<L5
ldi R17,>L5
xcall lpm32
movw R24,R28
st -y,R25
st -y,R24
xcall fpmule1x
movw R16,R2
movw R18,R4
xcall fpsub2
std y+4,R16
std y+5,R17
std y+6,R18
std y+7,R19
.dbline 28
;
; tt = (unsigned int )(result*100);
ldi R16,<L8
ldi R17,>L8
xcall lpm32
movw R24,R28
adiw R24,4
st -y,R25
st -y,R24
xcall fpmule1
std y+12,R16
std y+13,R17
std y+14,R18
std y+15,R19
ldd R2,y+12
ldd R3,y+13
ldd R4,y+14
ldd R5,y+15
ldi R16,<L9
ldi R17,>L9
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpcmp2
brlt L6
ldd R2,y+12
ldd R3,y+13
ldd R4,y+14
ldd R5,y+15
ldi R16,<L9
ldi R17,>L9
xcall lpm32
st -y,R19
st -y,R18
st -y,R17
st -y,R16
movw R16,R2
movw R18,R4
xcall fpsub2
xcall fpint
movw R24,R16
subi R24,0 ; offset = 32768
sbci R25,128
movw R12,R24
xjmp L7
L6:
ldd R16,y+12
ldd R17,y+13
ldd R18,y+14
ldd R19,y+15
xcall fpint
movw R12,R16
L7:
movw R10,R12
.dbline 29
; SEI();
sei
.dbline 31
;
; return tt;
movw R16,R10
.dbline -2
L1:
adiw R28,16
xcall pop_gset4
adiw R28,4
.dbline 0 ; func end
ret
.dbsym r tt 10 i
.dbsym l temp 8 D
.dbsym l result 4 D
.dbsym l k0 0 D
.dbsym l current 28 i
.dbsym l fullscal 24 D
.dbend
.dbfunc e turn_display _turn_display fV
; t4 -> R22
; t3 -> R12
; t5 -> R20,R21
; t2 -> R10
; t1 -> R14
; data -> y+15
; point_flag -> y+13
; channel -> R20
.even
_turn_display::
st -y,r19
st -y,r18
xcall push_gset5
mov R20,R16
sbiw R28,3
.dbline -1
.dbline 35
; }
;
; void turn_display(unsigned char channel,unsigned char point_flag,unsigned int data)
; {
.dbline 38
; unsigned char t1,t2,t3,t4;
; unsigned int t5;
; if( pannel_led[channel].up_down==0xa5)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+6
ldi R25,>_pannel_led+6
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,165
breq X0
xjmp L11
X0:
.dbline 39
; {
.dbline 40
; if( pannel_led[channel].state==0x5a)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,90
brne L14
.dbline 41
; {
.dbline 42
; PORTD |= 0x01;
sbi 0xb,0
.dbline 43
; PORTD &= 0x7f;
in R24,0xb
andi R24,127
out 0xb,R24
.dbline 44
; }
xjmp L12
L14:
.dbline 45
; else if(pannel_led[channel].state==0)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R2,z+0
tst R2
brne L17
.dbline 46
; {
.dbline 47
; PORTD&=0x7e;
in R24,0xb
andi R24,126
out 0xb,R24
.dbline 48
; }
xjmp L12
L17:
.dbline 49
; else if(pannel_led[channel].state==0xa5)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,165
breq X1
xjmp L12
X1:
.dbline 50
; {
.dbline 51
; PORTD |= 0x03;
in R24,0xb
ori R24,3
out 0xb,R24
.dbline 52
; PORTD &= 0x7f;
in R24,0xb
andi R24,127
out 0xb,R24
.dbline 53
; }
.dbline 54
; }
xjmp L12
L11:
.dbline 55
; else if(pannel_led[channel].up_down==0x5a)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+6
ldi R25,>_pannel_led+6
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,90
brne L23
.dbline 56
; {
.dbline 57
; if( pannel_led[channel].state==0x5a)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,90
brne L26
.dbline 58
; {
.dbline 59
; PORTD |= 0x02;
sbi 0xb,1
.dbline 60
; PORTD &= 0x7f;
in R24,0xb
andi R24,127
out 0xb,R24
.dbline 61
; }
xjmp L27
L26:
.dbline 62
; else if(pannel_led[channel].state==0)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R2,z+0
tst R2
brne L29
.dbline 63
; {
.dbline 64
; PORTD&=0xfd;
in R24,0xb
andi R24,253
out 0xb,R24
.dbline 65
; }
xjmp L30
L29:
.dbline 66
; else if(pannel_led[channel].state==0xa5)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,165
brne L32
.dbline 67
; {
.dbline 68
; PORTD |= 0x03;
in R24,0xb
ori R24,3
out 0xb,R24
.dbline 69
; PORTD &= 0x7f;
in R24,0xb
andi R24,127
out 0xb,R24
.dbline 70
; }
L32:
L30:
L27:
.dbline 71
; }
L23:
L12:
.dbline 74
;
;
; t1 = channel/10;
ldi R17,10
mov R16,R20
xcall div8u
mov R14,R16
.dbline 75
; t2 = channel%10;
ldi R17,10
mov R16,R20
xcall mod8u
mov R10,R16
.dbline 76
; if(!t1)
tst R14
brne L35
.dbline 77
; led7_display(12,0,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
clr R18
ldi R16,12
xcall _led7_display
xjmp L36
L35:
.dbline 79
; else
; led7_display(t1,0,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
clr R18
mov R16,R14
xcall _led7_display
L36:
.dbline 81
;
; led7_display(t2,1,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,1
mov R16,R10
xcall _led7_display
.dbline 82
; if(pannel_led[channel].state!=0xa5)
ldi R24,26
mul R24,R20
movw R30,R0
ldi R24,<_pannel_led+21
ldi R25,>_pannel_led+21
add R30,R24
adc R31,R25
ldd R24,z+0
cpi R24,165
brne X2
xjmp L37
X2:
.dbline 83
; {WDR();
.dbline 83
wdr
.dbline 84
; if(channel<36)
cpi R20,36
brlo X3
xjmp L40
X3:
.dbline 85
; {
.dbline 86
; if(point_flag == 1)
ldd R24,y+13
cpi R24,1
breq X4
xjmp L42
X4:
.dbline 87
; {
.dbline 88
; CLI();
cli
.dbline 89
; WDR();
wdr
.dbline 90
; t5 = data;
ldd R20,y+15
ldd R21,y+16
.dbline 91
; t1 = t5/1000;
ldi R18,1000
ldi R19,3
movw R16,R20
xcall div16u
mov R14,R16
.dbline 92
; t2 = (t5%1000)/100;
ldi R18,1000
ldi R19,3
movw R16,R20
xcall mod16u
ldi R18,100
ldi R19,0
xcall div16u
mov R10,R16
.dbline 93
; t3 = ((t5%1000)%100)/10;
ldi R18,1000
ldi R19,3
movw R16,R20
xcall mod16u
ldi R18,100
ldi R19,0
xcall mod16u
ldi R18,10
ldi R19,0
xcall div16u
mov R12,R16
.dbline 94
; t4 = ((t5%1000)%100)%10;
ldi R18,1000
ldi R19,3
movw R16,R20
xcall mod16u
ldi R18,100
ldi R19,0
xcall mod16u
ldi R18,10
ldi R19,0
xcall mod16u
mov R22,R16
.dbline 95
; if(t1)
tst R14
breq L44
.dbline 96
; {
.dbline 97
; led7_display(t1,2,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,2
mov R16,R14
xcall _led7_display
.dbline 98
; led7_display(t2,3,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,3
mov R16,R10
xcall _led7_display
.dbline 99
; led7_display(t3,4,1,1);
ldi R24,1
std y+2,R24
std y+0,R24
ldi R18,4
mov R16,R12
xcall _led7_display
.dbline 100
; led7_display(t4,5,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,5
mov R16,R22
xcall _led7_display
.dbline 101
; }
xjmp L45
L44:
.dbline 103
; else
; {
.dbline 104
; if(t2)
tst R10
breq L46
.dbline 105
; {
.dbline 106
; led7_display(12,2,0,1); // t1=0
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,2
ldi R16,12
xcall _led7_display
.dbline 107
; led7_display(t2,3,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,3
mov R16,R10
xcall _led7_display
.dbline 108
; led7_display(t3,4,1,1);
ldi R24,1
std y+2,R24
std y+0,R24
ldi R18,4
mov R16,R12
xcall _led7_display
.dbline 109
; led7_display(t4,5,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,5
mov R16,R22
xcall _led7_display
.dbline 110
; }
xjmp L47
L46:
.dbline 112
; else
; { // t1=0,t2=0
.dbline 113
; if(t3)
tst R12
breq L48
.dbline 114
; {
.dbline 115
; led7_display(12,2,0,1); // t3!=0
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,2
ldi R16,12
xcall _led7_display
.dbline 116
; led7_display(12,3,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,3
ldi R16,12
xcall _led7_display
.dbline 117
; led7_display(t3,4,1,1);
ldi R24,1
std y+2,R24
std y+0,R24
ldi R18,4
mov R16,R12
xcall _led7_display
.dbline 118
; led7_display(t4,5,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,5
mov R16,R22
xcall _led7_display
.dbline 119
; }
xjmp L49
L48:
.dbline 121
; else
; { //t1=0,t2=0,t3=0
.dbline 122
; if(t4)
tst R22
breq L50
.dbline 123
; {
.dbline 124
; led7_display(12,2,0,1);
ldi R24,1
std y+2,R24
clr R2
std y+0,R2
ldi R18,2
ldi R16,12
xcall _led7_display
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -