From: ian Date: Sun, 25 Dec 2005 13:04:49 +0000 (+0000) Subject: getwritebyte_polarity, etc. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=0726c5fcb7d3184e4ababa78dd2367f00eed794c;p=trains.git getwritebyte_polarity, etc. --- diff --git a/detpic/reverse.asm b/detpic/reverse.asm index abe7eb0..1e57c37 100644 --- a/detpic/reverse.asm +++ b/detpic/reverse.asm @@ -173,12 +173,18 @@ board_next_none board_next_none_more_message panic morse_RL +;---------------------------------------------------------------------- +polarity_master_init + panic morse_URM + ; need to set up polarity_cmds + ;---------------------------------------------------------------------- needwrite_polarity -; _needwrite will see if we need to talk to a slave +; needwrite_ 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 @@ -197,10 +203,23 @@ polarity_needwrite_loop pop return +near_getwritebyteyes code ;---------------------------------------------------------------------- -polarity_master_init - panic morse_URM - ; need to set up polarity_cmds +getwritebyte_polarity +; getwritebyte_ 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