From 37a3724dfd1313930b731a6950044b5f46775a9c Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 30 Dec 2005 00:34:55 +0000 Subject: [PATCH] fix totally bogus single-byte serial command handling; consequently rearrange sections a bit; remove old dead strange table entries from serialrx_if_multibyte table --- detpic/energy.asm | 11 +++++------ detpic/panic.asm | 2 +- detpic/program.asm | 23 +++++++++-------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/detpic/energy.asm b/detpic/energy.asm index 9fb51ef..5f3032c 100644 --- a/detpic/energy.asm +++ b/detpic/energy.asm @@ -105,11 +105,9 @@ power_fault_init @ ; now we are Off return +command_power_section code 0x2080 ;-------------------- -command_power @ - bra_nc command_power_off - ; command is ON: - +command_power_on @ ; Off -> On; noop in other states pinlat_ifl p0_booster_shutdown return ; On or Retry @@ -123,7 +121,7 @@ command_power @ goto cdu_on ;---------- -command_power_off +command_power_off @ ; On -> Off; noop in other states pinlat_ifh p0_booster_shutdown return ; Off, Stopping or Persists @@ -136,6 +134,7 @@ power_off_now pin_vh p0_booster_shutdown goto cdu_off +code2 code ;-------------------- power_fault_intrl @ bt_f_if0 INTCON3, INT1IF @@ -143,7 +142,7 @@ power_fault_intrl @ ; we have a fault: bc_f INTCON3, INT1IF - rcall power_off_now + call power_off_now mov_fw retry_wait bra_z power_fault_stop ; we were Off or On, goto Stopping diff --git a/detpic/panic.asm b/detpic/panic.asm index c3ca79e..1be0db6 100644 --- a/detpic/panic.asm +++ b/detpic/panic.asm @@ -542,7 +542,7 @@ near_gots code got_aargh @ panic morse_T -near_serialrx_table code 0x2100 +command_crashed_section code 0x2100 ;---------- command_crashed @ panic_crashread_commanded @ diff --git a/detpic/program.asm b/detpic/program.asm index 860bf63..3549f40 100644 --- a/detpic/program.asm +++ b/detpic/program.asm @@ -113,16 +113,15 @@ serialrx_generalmsg @ ; FSR0 -> start of message undefined ; *FSR0 message undefined ; -; ; INDF0=MM ww ww ww ww ii ii ii - rlc_fw INDF0 ; W = ww ww ww ww ii ii ii ?? C=MM Z=00 - bra_c serialrx_if_multibyte + mov_fw INDF0 + bra_n serialrx_if_multibyte bra_z command_crashed - ; single-byte non-0 command, has to be ON or OFF - ; ie supposedly ; INDF0=zz zz II zz zz zz zz PP C=zz - rrc_fw INDF0 ; W = zz zz zz II zz zz zz zz C=PP - xor_lw 0x10 ; W = zz zz zz zz zz zz zz zz C=PP Z=OK - bra_n serialrx_bad - goto command_power + + xor_lw 0x21 + bra_z command_power_on + xor_lw 0x01 + bra_z command_power_off + bra serialrx_bad ;----- serialrx_if_multibyte @@ -149,15 +148,12 @@ serialrx_if_multibyte goto serialrx_bad ; 1 1110 xxx goto serialrx_bad ; 1 1111 xxx - goto serialrx_bad ; 0 0000 xxx - goto serialrx_bad ; 0 0001 xxx - goto serialrx_bad ; 0 0000 xxx - ;----- serialrx_bad mov_ff INDF0, t panic morse_HX +code2 code ;-------------------- command_ping mov_fw POSTINC0 @@ -169,7 +165,6 @@ command_ping command_ping_bad panic morse_HP -code2 code ;====================================================================== ; SLAVE -- 2.30.2