interrupts: Don't wake up if not sleeping
authorJakob Gruber <jakob.gruber@gmail.com>
Mon, 23 Jul 2012 16:46:48 +0000 (18:46 +0200)
committerJakob Gruber <jakob.gruber@gmail.com>
Thu, 26 Jul 2012 12:40:46 +0000 (14:40 +0200)
This caused the CPU to wake up even if it was explicitly set to
cpu_Stopped.

simavr/sim/sim_interrupts.c

index 9334b03..0d98c9f 100644 (file)
@@ -117,7 +117,7 @@ avr_raise_interrupt(
 
                if (!table->pending_wait)
                        table->pending_wait = 1;                // latency on interrupts ??
-               if (avr->state != cpu_Running) {
+               if (avr->state == cpu_Sleeping) {
                        if (vector->trace)
                                printf("Waking CPU due to interrupt\n");
                        avr->state = cpu_Running;       // in case we were sleeping