projects
/
simavr
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e3e150
)
uart: Now use avr_clear_interrupt_if
author
Michel Pollet
<buserror@gmail.com>
Tue, 11 May 2010 11:36:26 +0000
(12:36 +0100)
committer
Michel Pollet
<buserror@gmail.com>
Tue, 11 May 2010 11:36:26 +0000
(12:36 +0100)
New function simplifies clearing pending bits
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_uart.c
patch
|
blob
|
history
diff --git
a/simavr/sim/avr_uart.c
b/simavr/sim/avr_uart.c
index
ee306da
..
c1e82f6
100644
(file)
--- 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);
}
}