From 58e42fda81e42df6f5361bb2a2d6205e13e208e6 Mon Sep 17 00:00:00 2001 From: SarahW Date: Fri, 26 Apr 2019 09:02:55 +0100 Subject: [PATCH] Don't enable RTC clock on speed change if RTC timer not enabled. Fixes crash when changing configuration with XT models. --- src/nvr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nvr.c b/src/nvr.c index 3c68768..e9af3b6 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -65,6 +65,11 @@ void nvr_recalc() { int c; + if (!(nvrram[RTC_REGA] & RTC_RS)) + { + timer_disable(&rtc_timer); + return; + } c = 1 << ((nvrram[RTC_REGA] & RTC_RS) - 1); timer_set_delay_u64(&rtc_timer, (uint64_t)(RTCCONST * c)); }