From: Jakob Gruber Date: Mon, 23 Jul 2012 16:46:48 +0000 (+0200) Subject: interrupts: Don't wake up if not sleeping X-Git-Tag: v1.0~48 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=d7f5a703ce3ac183ddef9651f4f97e812bae0234;p=sx%2Fsimavr.git interrupts: Don't wake up if not sleeping This caused the CPU to wake up even if it was explicitly set to cpu_Stopped. --- diff --git a/simavr/sim/sim_interrupts.c b/simavr/sim/sim_interrupts.c index 9334b03..0d98c9f 100644 --- a/simavr/sim/sim_interrupts.c +++ b/simavr/sim/sim_interrupts.c @@ -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