; 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
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
pin_vh p0_booster_shutdown
goto cdu_off
+code2 code
;--------------------
power_fault_intrl @
bt_f_if0 INTCON3, INT1IF
; 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
got_aargh @
panic morse_T
-near_serialrx_table code 0x2100
+command_crashed_section code 0x2100
;----------
command_crashed @
panic_crashread_commanded @
; 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
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
command_ping_bad panic morse_HP
-code2 code
;======================================================================
; SLAVE