From 550837b15bc11ba047fa9f8d48ece86c293917b1 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 8 Mar 2020 21:11:30 -0700 Subject: [PATCH] TIMER: Prefer a stable calibrated clock which ticks slower than the host --- sim_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim_timer.c b/sim_timer.c index 7fa6bd38..6ff31910 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -888,7 +888,7 @@ rtc->vtime = rtc->rtime; rtc->nxintv = 1000; rtc->ticks = 0; rtc->last_hz = rtc->hz; -rtc->hz = 0; +rtc->hz = ticksper; rtc->based = time; rtc->currd = time; rtc->initd = time; @@ -943,9 +943,9 @@ if (rtc->hz != ticksper) { /* changing tick rate? */ (rtc->last_hz != ticksper) && (ticksper != 0)) rtc->currd = (int32)(sim_timer_inst_per_sec () / ticksper); - _rtcn_configure_calibrated_clock (tmr); rtc->last_hz = rtc->hz; rtc->hz = ticksper; + _rtcn_configure_calibrated_clock (tmr); if (ticksper != 0) { RTC *crtc = &rtcs[sim_calb_tmr];