From: Jakob Gruber Date: Thu, 26 Jul 2012 11:05:21 +0000 (+0200) Subject: simavr: Do not call avr_terminate in run callbacks X-Git-Tag: v1.0~45 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=98a2078b49ca5b0324acaa2257504d7952389b2c;p=sx%2Fsimavr.git simavr: Do not call avr_terminate in run callbacks 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. --- diff --git a/simavr/sim/sim_avr.c b/simavr/sim/sim_avr.c index 37fae8f..7869f0d 100644 --- a/simavr/sim/sim_avr.c +++ b/simavr/sim/sim_avr.c @@ -233,7 +233,6 @@ void avr_callback_run_gdb(avr_t * avr) 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; } @@ -288,7 +287,6 @@ void avr_callback_run_raw(avr_t * avr) 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; }