chiark / gitweb /
make sure we do not answer Z to i2cmu_write_start when it's not ours, in case main...
authorian <ian>
Fri, 30 Dec 2005 01:48:04 +0000 (01:48 +0000)
committerian <ian>
Fri, 30 Dec 2005 01:48:04 +0000 (01:48 +0000)
detpic/panic.asm

index 1be0db6c4e2dc7bc55c379d258cb2d18aac1a659..550aa4c707003ff62ccecb3f48143808bfd38e50 100644 (file)
@@ -20,6 +20,7 @@ panicst_restart_i2c           equ     7
 panicst_acked                  equ     5
 panicst_ferroerr               equ     4
 panicst_writeslave             equ     3
+panicst_onlyourwrite           equ     2
 
 panic_valcount                 res     1
 
@@ -463,6 +464,7 @@ write_if_setbytetowrite
        bc_w    7
        mov_wf  panic_valcount
        bs_f    panicst, panicst_writeslave
+       bs_f    panicst, panicst_onlyourwrite
        return
 
 ;----------
@@ -500,9 +502,11 @@ pan_i2cmu_read_got_byte
 ;----------
 pan_i2cmu_write_next_byte
        mov_fw  panic_valcount
-       bs_f    STATUS, Z
-       bt_f_if1 panicst, panicst_writeslave
        bc_f    STATUS, Z
+       bt_f_if0 panicst, panicst_onlyourwrite
+       retlw   0x00
+       bt_f_if0 panicst, panicst_writeslave
+       bs_f    STATUS, Z
        bc_f    panicst, panicst_writeslave
        return