projects
/
sx
/
simavr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
regExp
home
|
summary
|
tags
|
heads
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
raw
|
patch
| inline |
side by side
(parent:
5868219
)
Commit
8467783d44dc5b36a7b1fcb8c70403238f41ce1a
author
Philip Åkesson
<philip.akesson@gmail.com>
Mon, 28 Nov 2016 15:02:02 +0000
(16:02 +0100)
committer
Philip Åkesson
<philip.akesson@gmail.com>
Sun, 11 Dec 2016 13:15:40 +0000
(14:15 +0100)
Clear interrupt instead of just the rxc bit
simavr/sim/avr_uart.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_uart.c
b/simavr/sim/avr_uart.c
index 0fff23694d0cd423ad7cb808fa5cad922397bc05..2a69c16e2a3b0bcdb9a89dea7b424f4ec85f35f3 100644
(file)
--- a/
simavr/sim/avr_uart.c
+++ b/
simavr/sim/avr_uart.c
@@
-98,8
+98,9
@@
static uint8_t avr_uart_read(struct avr_t * avr, avr_io_addr_t addr, void * para
{
avr_uart_t * p = (avr_uart_t *)param;
- // clear the rxc bit in case the code is using polling
- avr_regbit_clear(avr, p->rxc.raised);
+ // clear the rxc interrupt in case the code is using polling
+ uint8_t rxc = avr_regbit_get(avr, p->rxc.raised);
+ avr_clear_interrupt_if(avr, &p->rxc, rxc);
if (!avr_regbit_get(avr, p->rxen)) {
avr->data[addr] = 0;