From 60b884819178c99f08c7a6c08a2ef87c5feaf3fe Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Fri, 28 Feb 2020 19:36:58 -0500 Subject: [PATCH] SCP: Backed out of timer change. --- sim_timer.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sim_timer.c b/sim_timer.c index 4377b81..b120716 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -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]; @@ -2451,16 +2451,6 @@ return SCPE_OK; clock with an appropriate tick rate, an internal clock is run that meets this requirement, OR when asynch clocks are enabled, the internal clock is always run. - - Some simulators have clocks that have dynamically programmable tick - rates. Such a clock is only a reliable candidate to be the calibrated - clock if it uses a single tick rate rather than changing the tick rate - on the fly. Generally most systems like this, under normal conditions - don't change their tick rates unless they're running something that is - examining the behavior of the clock system (like a diagnostic). Under - these conditions this clock is removed from the potential selection as - "the" calibrated clock all others are relative to and if necessary, an - internal calibrated clock is selected. */ static void _rtcn_configure_calibrated_clock (int32 newtmr) { @@ -2473,8 +2463,7 @@ for (tmr=0; tmrhz) && (rtc->hz <= (uint32)sim_os_tick_hz) && - (rtc->clock_unit) && - ((rtc->last_hz == 0) || (rtc->last_hz == rtc->hz))) + (rtc->clock_unit)) break; } if (tmr == SIM_NTIMERS) { /* None found? */ @@ -2510,7 +2499,7 @@ if (tmr == SIM_NTIMERS) { /* None found? */ SIM_INTERNAL_UNIT.action = &sim_timer_clock_tick_svc; SIM_INTERNAL_UNIT.flags = UNIT_IDLE; sim_register_internal_device (&sim_int_timer_dev); /* Register Internal timer device */ - sim_rtcn_init_unit_ticks (&SIM_INTERNAL_UNIT, (int32)((CLK_INIT*CLK_TPS)/sim_int_clk_tps), SIM_INTERNAL_CLK, sim_int_clk_tps); + sim_rtcn_init_unit (&SIM_INTERNAL_UNIT, (int32)((CLK_INIT*CLK_TPS)/sim_int_clk_tps), SIM_INTERNAL_CLK); SIM_INTERNAL_UNIT.action (&SIM_INTERNAL_UNIT); /* Force tick to activate timer */ } return;