Commit 98a2078b49ca5b0324acaa2257504d7952389b2c
authorJakob Gruber <jakob.gruber@gmail.com>
Thu, 26 Jul 2012 11:05:21 +0000 (13:05 +0200)
committerJakob Gruber <jakob.gruber@gmail.com>
Thu, 26 Jul 2012 12:40:46 +0000 (14:40 +0200)
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

index 37fae8f4d554c3404b227b3d85e6787f844401a0..7869f0d497f0067cc12389a90425bd1444355733 100644 (file)
@@ -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;
                }