From 630883c7ad7b7db4b59b3a8a9fa5a975408d3278 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Tue, 11 May 2010 12:36:26 +0100 Subject: [PATCH] uart: Now use avr_clear_interrupt_if New function simplifies clearing pending bits Signed-off-by: Michel Pollet --- simavr/sim/avr_uart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/simavr/sim/avr_uart.c b/simavr/sim/avr_uart.c index ee306da..c1e82f6 100644 --- a/simavr/sim/avr_uart.c +++ b/simavr/sim/avr_uart.c @@ -147,11 +147,8 @@ static void avr_uart_write(struct avr_t * avr, avr_io_addr_t addr, uint8_t v, vo avr_core_watch_write(avr, addr, v); - // if writing one to a one, clear bit - if (udre && avr_regbit_get(avr, p->udrc.raised)) - avr_regbit_clear(avr, p->udrc.raised); - if (txc && avr_regbit_get(avr, p->txc.raised)) - avr_regbit_clear(avr, p->txc.raised); + avr_clear_interupt_if(avr, &p->udrc, udre); + avr_clear_interupt_if(avr, &p->txc, txc); } } -- 2.39.5