From cf56b113217dea164138565156c3e726557bded8 Mon Sep 17 00:00:00 2001 From: Mark Emmer Date: Sun, 2 Mar 2014 22:49:04 -0600 Subject: [PATCH] SDS: Adjust real-time clock pulse interrupt period Clock is running twice as fast as it should -- 120 interrupts per second instead of 60. Cannot find problem in initialization or calibration or count-down code, so for now, divide rtc_tps by 2 prior to invoking sim_rtcn_calb. Now 940 Executive reports wall-clock time advancing at proper rate. --- SDS/sds_cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SDS/sds_cpu.c b/SDS/sds_cpu.c index 9fda030c..382221e4 100644 --- a/SDS/sds_cpu.c +++ b/SDS/sds_cpu.c @@ -1582,13 +1582,17 @@ return SCPE_OK; a unit service routine and a reset routine. The service routine sets an interrupt that invokes the clock counter. The clock counter is a "one instruction interrupt", and only MIN/SKR are valid. + + Temporarily divide rtc_tps by 2 because clock is running twice as + fast as it should. Eventually have to find problem in the clock + calibration or setup code. */ t_stat rtc_svc (UNIT *uptr) { if (rtc_pie) /* set pulse intr */ int_req = int_req | INT_RTCP; -sim_activate (&rtc_unit, sim_rtcn_calb (rtc_tps, TMR_RTC)); /* reactivate */ +sim_activate (&rtc_unit, sim_rtcn_calb (rtc_tps/2, TMR_RTC)); /* reactivate */ return SCPE_OK; }