From 54993732dddff7ac2098205fa56fdb538ad7ae4b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 29 May 2017 23:12:37 -0700 Subject: [PATCH] TIMER: Properly queue all clocks when returning from sim_instr() as reported in #460 --- sim_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim_timer.c b/sim_timer.c index 8c9b286e..41c06ed3 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -2224,8 +2224,8 @@ for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { if (clock_time < 0) clock_time = 0; /* Stop clock assist unit and make sure the clock unit has a tick queued */ - sim_cancel (&sim_timer_units[tmr]); - if (rtc_hz[tmr]) { + if (sim_is_active (&sim_timer_units[tmr])) { + sim_cancel (&sim_timer_units[tmr]); sim_debug (DBG_QUE, &sim_timer_dev, "sim_stop_timer_services() - tmr=%d scheduling %s after %d\n", tmr, sim_uname (sim_clock_unit[tmr]), clock_time); _sim_activate (sim_clock_unit[tmr], clock_time); }