Commit a29ada2d37fed04f6c4f568d99f3538f29fbc8f5
authorbsekisser <squirmyworms@embarqmail.com>
Wed, 20 Nov 2013 16:37:49 +0000 (11:37 -0500)
committerbsekisser <squirmyworms@embarqmail.com>
Wed, 20 Nov 2013 16:37:49 +0000 (11:37 -0500)
modified:   simavr/sim/avr_uart.c

simavr/sim/avr_uart.c

index 149d8b9e56fd4b38ac1c02407c3e2391036ede0e..9eff694438e0ce78a52f1beb47ee377e0ba1f533 100644 (file)
@@ -192,8 +192,11 @@ static void avr_uart_write(struct avr_t * avr, avr_io_addr_t addr, uint8_t v, vo
                //uint8_t udre = avr_regbit_get(avr, p->udrc.raised);
                uint8_t txc = avr_regbit_get(avr, p->txc.raised);
 
-                // required for u2x (double uart transmission speed)
-               avr_core_watch_write(avr, addr, v);
+                // setting u2x (double uart transmission speed) may also involve
+                // overwriting read only flags, therefore set u2x explicitly.
+                if(addr == p->u2x.reg) {
+                       avr_regbit_setto_raw(avr, p->u2x, v);
+                }
 
                //avr_clear_interrupt_if(avr, &p->udrc, udre);
                avr_clear_interrupt_if(avr, &p->txc, txc);