Do not let code clear the UDRE flag in USART.
authorSami Liedes <sliedes@cc.hut.fi>
Mon, 28 Feb 2011 21:33:08 +0000 (23:33 +0200)
committerMichel Pollet <buserror@gmail.com>
Wed, 9 Mar 2011 07:57:07 +0000 (07:57 +0000)
It's a read only location and clearing it may break software that
assumes it cannot be cleared.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
simavr/sim/avr_uart.c

index a297bb9..4e6f0e5 100644 (file)
@@ -158,14 +158,14 @@ static void avr_uart_write(struct avr_t * avr, avr_io_addr_t addr, uint8_t v, vo
        }
        if (addr == p->udrc.raised.reg) {
                // get the bits before the write
-               uint8_t udre = avr_regbit_get(avr, p->udrc.raised);
+               //uint8_t udre = avr_regbit_get(avr, p->udrc.raised);
                uint8_t txc = avr_regbit_get(avr, p->txc.raised);
 
                // no need to write this value in here, only the
                // interupt flags needs clearing!
                // avr_core_watch_write(avr, addr, v);
 
-               avr_clear_interupt_if(avr, &p->udrc, udre);
+               //avr_clear_interupt_if(avr, &p->udrc, udre);
                avr_clear_interupt_if(avr, &p->txc, txc);
        }
 }