From 98a2078b49ca5b0324acaa2257504d7952389b2c Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Thu, 26 Jul 2012 13:05:21 +0200 Subject: [PATCH] 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. --- simavr/sim/sim_avr.c | 2 -- 1 file changed, 2 deletions(-) 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; } -- 2.39.5