; W = received byte
mov_wf b ; W = b = received byte
+ panic morse_TI4
mov_lfsr slavetable, 1
mov_ff cslot, FSR1L ; FSR1 -> slave's flags
return ; do not scan while booster PWM is off while polarising
; to avoid all trains disappearing and reappearing
- return ; do not scan yet
-
neg_fw outmsg_begin
add_wfw outmsg_end
and_lw outbuf_size - 1
mov_lfsr slavetable, 1 ; FSR1H -> slavetable
mov_ff cslot, FSR1L ; FSR1 -> new ste_flags
+ panic morse_TI3
bt_f_if1 POSTDEC1, stf_sentinel ; FSR1 -> ste_slave
bra nextslave_looparound
; Ok, we have a slave:
; INITIALISATION
mascan_init @
- mov_lw (slavetable + ste_flags + ste_size) & 0xff
- ; start with 1st actual slave
+ mov_lw (slavetable + ste_flags) & 0xff
+ ; pretend we've just done us, to start with 1st actual slave
mov_wf cslot
clr_f cbyte
bs_f cbyte, cbyte_halted ; serial output of `hello' will start us up
; TOS - 4 -> bt_f_if1 w, b'bbb'
; TOSL ???bbb00
; other conditions on entry and exit as for entry to addmsgs_<kind>, above
+ panic morse_TI5
rr_fw TOSL ; W = 0???bbb0
rr_w ; W = 00???bbb
ior_wfw 0xf8 ; W = 11111bbb
;======================================================================
; ACTUAL TRANSMISSION
+boo
+ panic morse_TI1
+
;----------------------------------------------------------------------
serialtx_intrl @
; are we ready to transmit ?
xor_wfw outmsg_end
bra_z tx_bufempty
+ mov_fw INDF0
+ xor_lw 0x02
+ bra_z boo
mov_fw INDF0
mov_wf TXREG
bra_n tx_justsent_noacknmra