board_next_none_more_message
panic morse_RL
+;----------------------------------------------------------------------
+polarity_master_init
+ panic morse_URM
+ ; need to set up polarity_cmds
+
;----------------------------------------------------------------------
needwrite_polarity
-; <something>_needwrite will see if we need to talk to a slave
+; needwrite_<something> will see if we need to talk to a slave
; if not it will simply return
; if we _do_, it will store the slave no. in needwrite_slave
-; and then pop and return
+; and then pop and return. In this case getwritebyte_polarity
+; on this slave must provide a byte next time it is called.
; nb register usage may need to be adjusted for wiring into mascan i2cm_...
mov_lfsr polarity_cmds, 0
polarity_needwrite_loop
pop
return
+near_getwritebyteyes code
;----------------------------------------------------------------------
-polarity_master_init
- panic morse_URM
- ; need to set up polarity_cmds
+getwritebyte_polarity
+; getwritebyte_<something> finds a byte to write to a particular
+; slave. If we have something to write, puts the byte in W
+; and does `goto getwritebyte_yes'. Otherwise simply returns.
+;
+; on entry return, `no' branch-away, `yes'
+; cwslave slave number preserved preserved
+; W undefined trashed byte for slave
+;
+ mov_lfsr polarity_cmds, 0
+ add_wf FSR0L
+ mov_fw INDF0
+ bra_n getwritebyte_yes
+ ; no:
+ return
;======================================================================
include final.inc