From: Michel Pollet Date: Tue, 11 May 2010 11:36:26 +0000 (+0100) Subject: uart: Now use avr_clear_interrupt_if X-Git-Tag: v1.0a4~5 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=630883c7ad7b7db4b59b3a8a9fa5a975408d3278;p=sx%2Fsimavr.git uart: Now use avr_clear_interrupt_if New function simplifies clearing pending bits Signed-off-by: Michel Pollet --- 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); } }