; Master-specific initialisation.
call memory_erase
clr_f flags
- set_f xdebug+7
- clr_f xdebug+6
call serial_init
call i2cm_init
call serialtxbuf_init
call power_polarising_init
call power_fault_init
call watchdog_init
- clr_f xdebug+0
return
-boom3
- panic morse_TI3
-
;----------------------------------------
master_interrupt_low @
enter_interrupt_low
- D 0x80
- mov_lfsr 0x5f+2, 0
- mov_fw INDF0
- xor_lw 0x40
- bra_nz boom3
+ Dl 0x80
+ Df INTCON
+ Df INTCON2
+ Df INTCON3
+ Df PIR1
+ Df PIR2
+ Df PIR3
+ Dl 0x8d
call tick_intrl
- D 0x01
call nmra_serialrx_intrl
- D 0x02
call power_fault_intrl
- D 0x03
call serialtxfc_intrl
- D 0x04
call serialtx_intrl
- D 0x05
call points_local_intrl
- D 0x06
call i2cm_intrl
- bs_f xdebug+0, 5
+ Dl 0x8e
+ Df INTCON
+ Df INTCON2
+ Df INTCON3
+ Df PIR1
+ Df PIR2
+ Df PIR3
+ Dl 0x8f
panic morse_IL
;----------------------------------------------------------------------
serialrx_table_section code 0x2000
+;--------------------
+command_tellmode
+ mov_lw 0x09
+ goto serial_addbyte
+
;--------------------
serialrx_generalmsg @
;command_<something> has same calling convention:
bra_n serialrx_if_multibyte
bra_z command_crashed
- xor_lw 0x21
+ xor_lw 0x11
bra_z command_power_on
- xor_lw 0x01
+ xor_lw 0x10 ^ 0x11
bra_z command_power_off
+ xor_lw 0x0a ^ 0x10
+ bra_z command_tellmode
bra serialrx_bad
;-----
call serial_addbyte
mov_fw t
bra_n command_ping_bad
- mov_wf xdebug+6
goto serial_addbyte_another
command_ping_bad panic morse_HP