i2cm_intrl @
; handles i2c interrupt using i2cm_interrupt[_definite],
; according to the rules for <something>_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
; 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_<foo> here:
+ call polarity_needwrite
+ call points_needwrite
+ ; end of list of calls to needwrite_<foo>
+
+ ; 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
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_<foo> here:
- call polarity_needwrite
- call points_needwrite
- ; end of list of calls to needwrite_<foo>
-
- ; no, if we're here, no-one wants to write
- bra nextslave_nowrite
;----------------------------------------
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