Neither run_avr nor the examples expect avr_terminate to be called by
simavr itself.
This also caused issues for cleanup code (such as IRQ disconnections)
that did not know if avr_terminate had already been called or not.
if (!avr->sreg[S_I]) {
if (avr->log)
printf("simavr: sleeping with interrupts off, quitting gracefully\n");
- avr_terminate(avr);
avr->state = cpu_Done;
return;
}
if (!avr->sreg[S_I]) {
if (avr->log)
printf("simavr: sleeping with interrupts off, quitting gracefully\n");
- avr_terminate(avr);
avr->state = cpu_Done;
return;
}