From: ian Date: Fri, 30 Dec 2005 03:01:18 +0000 (+0000) Subject: actually reconsider who to write to if wslave is empty X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=f2faad353bfbfe2eaf71b16749026675a76a34f0;p=trains.git actually reconsider who to write to if wslave is empty --- diff --git a/detpic/mascan.asm b/detpic/mascan.asm index ad3eb8d..e8ed66f 100644 --- a/detpic/mascan.asm +++ b/detpic/mascan.asm @@ -46,8 +46,11 @@ i2cmu_write_next_byte i2cm_intrl @ ; handles i2c interrupt using i2cm_interrupt[_definite], ; according to the rules for _intrl. + bs_f xdebug+0, 3 + mov_ff PIR1, xdebug+1 bt_f_if0 PIR1, SSPIF return + bs_f xdebug+0, 4 call i2cm_interrupt_definite intrl_handled_nostack @@ -199,11 +202,22 @@ i2c_arrange_next_byte ; DECIDING WHICH SLAVE TO ADDRESS ;... i2c_arrange_something +i2cmu_done ; figure out what to do next - which pic to address, etc. bs_f cbyte, cbyte_halted tst_f_ifnz wslave ; anyone asked to write ? bra arrange_write + + ; Anyone else to write to ? + ; add calls to needwrite_ here: + call polarity_needwrite + call points_needwrite + ; end of list of calls to needwrite_ + + ; no, if we're here, no-one wants to write: + bs_f xdebug+0, 6 + nextslave_nowrite ; no writing needed, we consider reading: bt_f_if1 flags, flags_polarising @@ -239,22 +253,6 @@ nextslave_looparound call read_detection_head_master goto i2cmu_read_got_byte -;---------------------------------------- -i2cmu_done - ; So we've done one write. - bs_f cbyte, cbyte_halted - - tst_f_ifnz wslave ; anyone asked in the meantime ? - bra arrange_write - - ; Anyone else to write to ? - ; add calls to needwrite_ here: - call polarity_needwrite - call points_needwrite - ; end of list of calls to needwrite_ - - ; no, if we're here, no-one wants to write - bra nextslave_nowrite ;---------------------------------------- i2c_needwrite @ @@ -269,6 +267,7 @@ i2c_needwrite @ ;---------- arrange_write ; wslave slave to write to + bs_f xdebug+0, 0 bc_f cbyte, cbyte_halted mov_fw wslave mov_wf cwslave