📄 background.asm
字号:
push r6
push r12
push r13
push r14
push r15
sub #0xa,sp
DBG151:
DBG150:
DBG149:
; ENTRY
; V_sample in reg size 2
; corrected in reg size 2
; I_live_sample in reg size 2
; I_neutral_sample in reg size 2
; adc_buffer at stkloc 0 (0x0) size 10
; adc_ptr in reg size 2
; {
; int16_t V_sample;
; int16_t corrected;
; int16_t I_live_sample;
; int16_t I_neutral_sample;
; int16_t adc_buffer[5];
; int adc_ptr;
; adc_buffer[0] = SD16MEM2;
mov &0x116,0(sp)
DBG152:
; adc_buffer[1] = SD16MEM1;
mov &0x114,0x2(sp)
DBG153:
; adc_buffer[2] = SD16MEM0;
mov &0x112,0x4(sp)
DBG154:
; adc_ptr = -1;
mov #-0x1,r5
DBG155:
; V_sample = adc_buffer[ ++adc_ptr];
add #0x1,r5
mov r5,r13
rla r13
mov sp,r12
add r13,r12
mov @r12,r13
DBG156:
; if ((V_sample >= 32767 || V_sample <= -32767 ) && phase->V_endstops)
mov #0x7fff,r4
cmp r4,r13
jge SD16_ISR_L2
mov #-0x7fff,r12
cmp r13,r12
jl SD16_ISR_L1
SD16_ISR_L2:
mov &_phase,r12
add #0x86,r12
cmp.b #0x0,0(r12)
jeq SD16_ISR_L1
DBG157:
; phase->V_endstops--;
sub.b #0x1,0(r12)
DBG158:
SD16_ISR_L1:
; V_sample = dc_filter(&phase->V_dc_estimate[0], V_sample);
mov &_phase,r12
add #0x4,r12
call #_dc_filter
DBG159:
; phase->V_history[(int) phase->V_history_index] = V_sample;
mov &_phase,r6
mov.b 0x87(r6),r13
sxt r13
rla r13
add r6,r13
add #0xc,r13
mov r12,0(r13)
DBG160:
; accum48(phase->V_sq_accum, imul16_up(V_sample, V_sample));
mov r12,r13
call #_imul16_up
mov r13,r14
mov r12,r13
mov r6,r12
add #0x14,r12
call #_accum48
DBG161:
; I_live_sample = phase->current.I_history[0];
mov &_phase,r12
mov r12,r14
add #0x4a,r14
mov @r14,r13
DBG162:
; phase->current.I_history[0] = phase->current.I_history[1];
mov 0x4c(r12),0(r14)
DBG163:
; corrected = adc_buffer[ ++adc_ptr];
add #0x1,r5
mov r5,r15
rla r15
mov sp,r14
add r15,r14
mov @r14,r14
DBG164:
; if ((corrected >= 32767 || corrected <= -32767 ) && phase->current.I_endstops)
cmp r4,r14
jge SD16_ISR_L4
mov #-0x7fff,r15
cmp r14,r15
jl SD16_ISR_L3
SD16_ISR_L4:
cmp.b #0x0,0x4e(r12)
jeq SD16_ISR_L3
DBG165:
; phase->current.I_endstops--;
sub.b #0x1,0x4e(r12)
DBG166:
SD16_ISR_L3:
; phase->current.I_history[1] = corrected;
mov r14,0x4c(r12)
DBG167:
; I_live_sample = dc_filter(&phase->current.I_dc_estimate, I_live_sample);
add #0x24,r12
call #_dc_filter
DBG168:
; accum48(phase->current.I_sq_accum, imul16_up(I_live_sample, I_live_sample));
mov r12,r13
call #_imul16_up
mov r13,r14
mov r12,r13
mov &_phase,r12
add #0x34,r12
call #_accum48
DBG169:
; ++phase->current.sample_count;
mov &_phase,r12
mov r12,r13
add #0x40,r13
add #0x1,0(r13)
DBG170:
; I_neutral_sample = phase->neutral.I_history[0];
mov r12,r14
add #0x7a,r14
mov @r14,r13
DBG171:
; phase->neutral.I_history[0] = phase->neutral.I_history[1];
mov 0x7c(r12),0(r14)
DBG172:
; corrected = adc_buffer[ ++adc_ptr];
add #0x1,r5
rla r5
mov sp,r14
add r5,r14
mov @r14,r14
DBG173:
; if ((corrected >= 32767 || corrected <= -32767 ) && phase->neutral.I_endstops)
cmp r4,r14
jge SD16_ISR_L6
mov #-0x7fff,r15
cmp r14,r15
jl SD16_ISR_L5
SD16_ISR_L6:
cmp.b #0x0,0x7e(r12)
jeq SD16_ISR_L5
DBG174:
; phase->neutral.I_endstops--;
sub.b #0x1,0x7e(r12)
DBG175:
SD16_ISR_L5:
; phase->neutral.I_history[1] = corrected;
mov r14,0x7c(r12)
DBG176:
; I_neutral_sample = dc_filter(&phase->neutral.I_dc_estimate, I_neutral_sample);
add #0x54,r12
call #_dc_filter
DBG177:
; accum48(phase->neutral.I_sq_accum, imul16_up(I_neutral_sample, I_neutral_sample));
mov r12,r13
call #_imul16_up
mov r13,r14
mov r12,r13
mov &_phase,r12
add #0x64,r12
call #_accum48
DBG178:
; ++phase->neutral.sample_count;
mov &_phase,r12
mov r12,r13
add #0x70,r13
add #0x1,0(r13)
DBG179:
; phase->V_history_index = (phase->V_history_index + 1) & 0x3 ;
mov r12,r13
add #0x87,r13
mov.b @r13,r14
add.b #0x1,r14
and.b #0x3,r14
mov.b r14,0(r13)
DBG180:
; ++phase->sample_count;
add #0x1,0x80(r12)
mov 0x80(r12),r12
DBG181:
; if (phase->sample_count >= 1024 )
cmp #0x400,r12
jl SD16_ISR_L7
DBG183:
DBG182:
; {
; emeter.ui_anti_tamperring_status |= (0x0010) ;
mov #0x10,r12
bis r12,&_emeter+0x2
DBG184:
; _BIC_SR_IRQ( ( (0x0010) ) );
bic r12,0x18(sp)
DBG186:
DBG185:
; }
SD16_ISR_L7:
DBG187:
; EXIT
; .temp3 at stkloc 10 (0xa) size 14
DBG188:
add #0xa,sp
pop r15
pop r14
pop r13
pop r12
pop r6
pop r5
pop r4
reti
.dbgseg dbg_syms
.long 0x0
.long DBG51
.long 0x18
.long 0x0
.long 0x10002
.long 0x0
.long DBG52
.long 0x2
.long 0x0
.long 0x10002
.long 0x504e5f5f
.long 0x534d5241
.long 0x0
.long 0x0
.long 0x10002
.long 0x0
.long DBG189
.long 0x0
.long 0x64
.long 0x1010002
.long 0x0
.long 0xa0034
.long 0x5
.long 0x0
.long 0x0
DBG143:
.long 0x62622e
.long 0x0
.long DBG155
.long 0x0
.long 0x1640001
.long 0x0
.long 0x11
.long 0x0
.long DBG190
.long 0x0
.long 0x5f636461
.long 0x727470
.long 0x50102
.long 0x4
.long 0x4ffff
DBG190:
.long 0x62622e
.long 0x0
.long DBG156
.long 0x0
.long 0x1640001
.long 0x0
.long 0x12
.long 0x0
.long DBG191
.long 0x0
.long 0x61735f56
.long 0x656c706d
.long 0xd0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG159
.long 0x0
.long 0x1640001
.long 0x0
.long 0x15
.long 0x0
.long 0x0
.long 0x0
DBG191:
.long 0x62622e
.long 0x0
.long DBG159
.long 0x0
.long 0x1640001
.long 0x0
.long 0x15
.long 0x0
.long DBG192
.long 0x0
.long 0x61735f56
.long 0x656c706d
.long 0xc0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG161
.long 0x0
.long 0x1640001
.long 0x0
.long 0x18
.long 0x0
.long 0x0
.long 0x0
DBG192:
.long 0x62622e
.long 0x0
.long DBG162
.long 0x0
.long 0x1640001
.long 0x0
.long 0x19
.long 0x0
.long DBG193
.long 0x0
.long 0x0
.long DBG194
.long 0xd0102
.long 0x4
.long 0x4ffff
DBG193:
.long 0x62622e
.long 0x0
.long DBG164
.long 0x0
.long 0x1640001
.long 0x0
.long 0x1b
.long 0x0
.long DBG195
.long 0x0
.long 0x0
.long DBG196
.long 0xe0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG168
.long 0x0
.long 0x1640001
.long 0x0
.long 0x1f
.long 0x0
.long 0x0
.long 0x0
.long 0x62652e
.long 0x0
.long DBG168
.long 0x0
.long 0x1640001
.long 0x0
.long 0x1f
.long 0x0
.long 0x0
.long 0x0
DBG195:
.long 0x62622e
.long 0x0
.long DBG168
.long 0x0
.long 0x1640001
.long 0x0
.long 0x1f
.long 0x0
.long DBG197
.long 0x0
.long 0x0
.long DBG194
.long 0xc0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG169
.long 0x0
.long 0x1640001
.long 0x0
.long 0x20
.long 0x0
.long 0x0
.long 0x0
DBG197:
.long 0x62622e
.long 0x0
.long DBG171
.long 0x0
.long 0x1640001
.long 0x0
.long 0x23
.long 0x0
.long DBG198
.long 0x0
.long 0x0
.long DBG199
.long 0xd0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG173
.long 0x0
.long 0x1640001
.long 0x0
.long 0x25
.long 0x0
.long 0x0
.long 0x0
.long 0x62652e
.long 0x0
.long DBG173
.long 0x0
.long 0x1640001
.long 0x0
.long 0x25
.long 0x0
.long 0x0
.long 0x0
DBG198:
.long 0x62622e
.long 0x0
.long DBG173
.long 0x0
.long 0x1640001
.long 0x0
.long 0x25
.long 0x0
.long DBG200
.long 0x0
.long 0x0
.long DBG196
.long 0xe0102
.long 0x4
.long 0x4ffff
.long 0x0
.long DBG199
.long 0xd0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG177
.long 0x0
.long 0x1640001
.long 0x0
.long 0x29
.long 0x0
.long 0x0
.long 0x0
DBG200:
.long 0x62622e
.long 0x0
.long DBG177
.long 0x0
.long 0x1640001
.long 0x0
.long 0x29
.long 0x0
.long DBG201
.long 0x0
.long 0x0
.long DBG199
.long 0xc0102
.long 0x4
.long 0x4ffff
.long 0x62652e
.long 0x0
.long DBG178
.long 0x0
.long 0x1640001
.long 0x0
.long 0x2a
.long 0x0
.long 0x0
.long 0x0
.long 0x66652e
.long 0x0
.long DBG188
.long 0x0
.long 0x1650001
.long 0x0
.long 0xc1
.long 0x0
.long 0x0
.long 0x0
.pseg background_code
DBG145:
.dbgseg dbg_syms
.long 0x36314453
.long 0x5253495f
.long DBG145
.long 0x0
.long 0xff0001
; }
; uint16 ui_step_counter;
; uint32 ul_total_power_infact;
; static uint32 ul_energy_accu;
; _INTERRUPT [ (6 * 2) ] void TA_isr (void)
.iseg background_ivec_12,abs=0xffec
.data _TA_isr
.dbgseg dbg_syms
DBG144:
.long 0x695f4154
.long 0x7273
.long _TA_isr
.long 0x40
.long 0x1020001
.long DBG148
.long DBG203-DBG204
.long DBG205
.long DBG202
.long 0x0
.pseg background_code
DBG204:
.dbgseg dbg_syms
DBG148:
.long 0x66622e
.long 0x0
.long DBG204
.long 0x0
.long 0x1650001
.long 0x0
.long 0xcc
.long 0x0
.long DBG206
.long 0x0
.dbgseg dbg_line
DBG205:
.long DBG144
.long 0x0
.long _TA_isr
.long 0x1
.long DBG208
.long 0x2
.long DBG209
.long 0x3
.long DBG210
.long 0x4
.long DBG211
.long 0x5
.long DBG212
.long 0x6
.long DBG213
.long 0x7
.long DBG214
.long 0x8
.long DBG215
.long 0x9
.long DBG216
.long 0xa
.long DBG217
.long 0xb
.long DBG218
.long 0xc
.long DBG219
.long 0xd
.long DBG220
.long 0xe
.pseg background_code
.global _TA_isr
_TA_isr:
push r12
push r13
DBG209:
DBG208:
DBG207:
; ENTRY
; {
; TACCR0 += 8 ;
add #0x8,&0x172
DBG210:
; if((ul_energy_accu += ul_total_power_infact) >= ( (40960L*36000L) / 3200 )*1000 )
add &_ul_total_power_infact,&_ul_energy_accu
addc &_ul_total_power_infact+0x2,&_ul_energy_accu+0x2
mov &_ul_energy_accu,r12
mov &_ul_energy_accu+0x2,r13
sub #0x4000,r12
subc #0x1b77,r13
jnc TA_isr_L1
DBG212:
DBG211:
; {
; ul_energy_accu -= ( (40960L*36000L) / 3200 )*1000 ;
sub #0x4000,&_ul_energy_accu
subc #0x1b77,&_ul_energy_accu+0x2
DBG213:
; P1SEL &= ~ (0x0004) ;
bic.b #0x4,&0x26
; P1DIR |= (0x0004) ;
bis.b #0x4,&0x22
; P1OUT |= (0x0004) ; ;
bis.b #0x4,&0x21
DBG214:
; total_energy_led_remaining_time = 200 ;
mov #0xc8,&_total_energy_led_remaining_time
DBG216:
DBG215:
; }
TA_isr_L1:
; if (total_energy_led_remaining_time && --total_energy_led_remaining_time == 0)
cmp #0x0,&_total_energy_led_remaining_time
jeq TA_isr_L2
sub #0x1,&_total_energy_led_remaining_time
jne TA_isr_L2
DBG218:
DBG217:
; {
; P1SEL &= ~ (0x0004) ;
mov.b #0xfb,r12
and.b r12,&0x26
; P1DIR |= (0x0004) ;
bis.b #0x4,&0x22
; P1OUT &= ~ (0x0004) ; ;
and.b r12,&0x21
DBG220:
DBG219:
; }
TA_isr_L2:
DBG221:
; EXIT
; .temp4 at stkloc 0 (0x0) size 4
DBG222:
pop r13
pop r12
reti
.dbgseg dbg_syms
.long 0x0
.long DBG51
.long 0x4
.long 0x0
.long 0x10002
.long 0x0
.long DBG52
.long 0x2
.long 0x0
.long 0x10002
.long 0x504e5f5f
.long 0x534d5241
.long 0x0
.long 0x0
.long 0x10002
.long 0x66652e
.long 0x0
.long DBG222
.long 0x0
.long 0x1650001
.long 0x0
.long 0xd9
.long 0x0
.long 0x0
.long 0x0
.pseg background_code
DBG203:
.dbgseg dbg_syms
.long 0x695f4154
.long 0x7273
.long DBG203
.long 0x0
.long 0xff0001
; }
; _INTERRUPT [ (0 * 2) ] void BT_ISR(void)
.iseg background_ivec_0,abs=0xffe0
.data _BT_ISR
.dseg background_bss
.align 0x2
background_V4:
background_V3:
.bss 0x1
.bss 0x1
.align 0x2
background_V5:
.bss 0x2
.dbgseg dbg_syms
DBG202:
.long 0x495f5442
.long 0x5253
.long _BT_ISR
.long 0x40
.long 0x1020001
.long DBG206
.long DBG224-DBG225
.long DBG226
.long DBG223
.long 0x0
.pseg background_code
DBG225:
.dbgseg dbg_syms
DBG206:
.long 0x66622e
.long 0x0
.long DBG225
.long 0x0
.long 0x1650001
.long 0x0
.long 0xdb
.long 0x0
.long DBG227
.long 0x0
.dbgseg dbg_line
DBG226:
.long DBG202
.long 0x0
.long _BT_ISR
.long 0x1
.long DBG229
.long 0x2
.long DBG230
.long 0x6
.long DBG231
.long 0x7
.long DBG232
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -