Commit 90da54280f2ff2d91f2e51f41a5e747c56db6f94
authorMichel Pollet <buserror@gmail.com>
Wed, 6 Jun 2012 10:52:47 +0000 (11:52 +0100)
committerMichel Pollet <buserror@gmail.com>
Wed, 6 Jun 2012 10:52:47 +0000 (11:52 +0100)
Reset the SPI Interrupt Flag in SPSR uppon read of a SPI byte.

via sebastien.besombes@gmail.com
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_spi.c

index 05810bf2f32a9d07423ae192d022c730e15c1953..7a491b4b37e1d3bc84b37560db345d27878504c2 100644 (file)
@@ -41,6 +41,7 @@ static uint8_t avr_spi_read(struct avr_t * avr, avr_io_addr_t addr, void * param
        avr_spi_t * p = (avr_spi_t *)param;
        uint8_t v = p->input_data_register;
        p->input_data_register = 0;
+       avr_regbit_clear(avr, p->spi.raised);
 //     printf("avr_spi_read = %02x\n", v);
        return v;
 }