From d7f5a703ce3ac183ddef9651f4f97e812bae0234 Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Mon, 23 Jul 2012 18:46:48 +0200 Subject: [PATCH] interrupts: Don't wake up if not sleeping This caused the CPU to wake up even if it was explicitly set to cpu_Stopped. --- simavr/sim/sim_interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5