Skip to content

Commit

Permalink
Merge pull request buserror#502 from jack-greenberg/master
Browse files Browse the repository at this point in the history
Fix segfault with ATMega16m1 UART simulation
  • Loading branch information
buserror authored Aug 11, 2023
2 parents fc09b21 + 1cfdbf8 commit 13056a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions simavr/sim/avr_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,11 @@ avr_uart_init(
// status bits
// monitor code that reads the rxc flag, and delay it a bit
avr_register_io_read(avr, p->rxc.raised.reg, avr_uart_status_read, p);
if (p->fe.reg != p->rxc.raised.reg)
avr_register_io_read(avr, p->fe.reg, avr_uart_status_read, p);
if (p->fe.reg) {
if (p->fe.reg != p->rxc.raised.reg) {
avr_register_io_read(avr, p->fe.reg, avr_uart_status_read, p);
}
}

if (p->udrc.vector)
avr_register_io_write(avr, p->udrc.enable.reg, avr_uart_write, p);
Expand Down

0 comments on commit 13056a1

Please sign in to comment.