;----------
m_event_done_addressing
bt_f_if1 sspcon2, ACKSTAT
- bra m_bad_address_ack
+ bra m_no_address_ack
; OK, we got ack.
bc_f st, st_addressing
goto i2cmu_done
;----------
-m_bad_address_ack
- i2cpanic morse_SK
+m_no_address_ack
+ bt_f_if0 st, st_reading
+ bra m_bad_no_address_ack_write
+ clr_f st
+ rcall m_stop
+ goto i2cmu_slave_no_ack
+
+m_bad_no_address_ack_write
+ panic morse_SW
;========================================
; MASTER - WRITING
; At call On return
; State Idle/Reading-Wait Writing-Setup
; W slave number any
- mov_wf xdebug+3
- mov_ff st, xdebug+4
- set_f xdebug+5
tst_f_ifnz st
bra m_write_start_busy
mov_fw slave_next
bra_z m_stop
; ok, we want to read another:
- mov_wf xdebug+2
mov_wf slave
clr_f slave_next
bt_f_if0 st, st_writing ; because of i2cm_write_start ?
bs_f st, st_reading ; no, then we will want to read
bs_f SSPCON2, RSEN
- set_f xdebug+0
bra m_start_or_restart
;----------
;----------
; Macros: chkvals_start and chkval
-chkvals_start macro what
- mov_fw what
+chkvals_start macro chvals_what
+ mov_fw chvals_what
endm
-chkval macro lastval, value, label
- xor_lw value ^ lastval
- bra_z label
+chkval macro chkval_lastval, chkval_value, chkval_label
+ xor_lw chkval_value ^ chkval_lastval
+ bra_z chkval_label
endm
near_i2csu code
include program+externs.fin
include i2clib.inc
- include variables+vars.fin
-
end