Skip to content

Commit

Permalink
fix: Fix state of input pins after reset in AVR based boards.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Jun 15, 2024
1 parent c18dcef commit 30f30c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/boards/bsim_simavr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,7 @@ void bsim_simavr::MSetPin(int pin, unsigned char value) {
return;
if (Write_stat_irq[pin - 1] == NULL)
return;
pins[pin - 1].value = value;
avr_raise_irq(Write_stat_irq[pin - 1], value);
}

Expand Down Expand Up @@ -1548,6 +1549,11 @@ void bsim_simavr::MReset(int flags) {
avr_extint_set_strict_lvl_trig(avr, 5, 0);
avr_extint_set_strict_lvl_trig(avr, 6, 0);
avr_extint_set_strict_lvl_trig(avr, 7, 0);

for (int p = 0; p < MGetPinCount(); p++) {
MSetPin(p + 1, 0);
}
pins_reset();
}

unsigned short* bsim_simavr::DBGGetProcID_p(void) {
Expand Down

0 comments on commit 30f30c1

Please sign in to comment.