chiark / gitweb /
fix much braindamage surrounding mov_wf not setting flags and thus getting erroneous...
authorian <ian>
Fri, 30 Dec 2005 01:49:44 +0000 (01:49 +0000)
committerian <ian>
Fri, 30 Dec 2005 01:49:44 +0000 (01:49 +0000)
detpic/i2clib.asm
detpic/morse.messages

index b09c0870612c71d8c1234a354c1d199bb42f75f2..efd3ae47b7a5f2bb7f7acec0512218a958e2c4b9 100644 (file)
@@ -235,6 +235,9 @@ i2cm_write_start
 ;                              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
 
@@ -361,11 +364,13 @@ m_event_done_acking
                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
 
 ;----------
@@ -499,4 +504,6 @@ s_event_bad
   include program+externs.fin
   include i2clib.inc
 
+ include variables+vars.fin
+
   end
index 548198449909d0010fb94c48d48c1f363c106b5e..64df6fc2f3b5ae46c1507953d0fef7b7482bcb83 100644 (file)
@@ -54,6 +54,7 @@ SM    i2clib+panic:st,:sspstat,:sspcon1,:sspcon2 ; m.,i., ctrlr bad state
 SS     SSPSTAT,SSPCON1                 ; s.,i., controller bad state
 SK     i2clib+panic:slave              ; m. couldn't address slave (no ack)
 SN     i2clib+panic:slave              ; improper slave number
+SO     i2clib+panic:slave              ; improper next slave number
 SB     i2clib+panic:st                 ; improper i2cm_{read,write}_start
 SF     i2clib+panic:st                 ; improper i2cmu_write_next_byte Z
 SA     i2clib+panic:st                 ; improper i2cm_read_another