Commit 301121cce45e4db4c1d0e66d16dc42cb1246e36b
authorDoug Szumski <d.s.szumski@gmail.com>
Sat, 16 Aug 2014 13:15:58 +0000 (15:15 +0200)
committerDoug Szumski <d.s.szumski@gmail.com>
Sat, 16 Aug 2014 13:15:58 +0000 (15:15 +0200)
> This change fixes a problem where a TWI driver polling the
  TWSTO bit would run on the real device but not simavr.

> More detail in for example p188 of the ATMega32A datasheet
  (rev 815D-AVR-10/2013).

simavr/sim/avr_twi.c

index 808da9de1da21bc7aaeae497c65b5ac9e6c9162d..663357e90801164a4f60910af76684aba0f9fa44 100644 (file)
@@ -182,6 +182,7 @@ avr_twi_write(
                        if (p->state & TWI_COND_START) {
                                avr_raise_irq(p->io.irq + TWI_IRQ_OUTPUT,
                                                avr_twi_irq_msg(TWI_COND_STOP, p->peer_addr, 1));
+                               avr_regbit_clear(avr, p->twsto);
                        }
                }
                p->state = 0;