raiguard/ModernGadgets

Timed Alarms only work if System Uptime or Countdown Timer are enabled

PaddlesAU opened this issue · 1 comments

I've noticed that Alarm1 and Alarm2 alarms don't currently work unless System Uptime, or Countdown Timer, or both, are enabled.

As far as I can tell, it's caused by MeasureLocalTime being disabled unless one of these two options has been selected; because the MeasureAlarm[12]Diff depend on MeasureLocalTime, MeasureLocalTime being disabled means the Diff value isn't recalculated.

The solution seems to be to update MeasureLocalTime in Chronometer.ini to change the Disabled logic.
Replace
Disabled=(#showSystemUptime# = 0) && (#showEventCountdown# = 0)
with
Disabled=(#showSystemUptime# = 0) && (#showEventCountdown# = 0) && (#enableAlarm1# = 0) && (#enableAlarm2# = 0)

Making this change locally fixed the problem; alarms sounded as expected.

Alternatively, I'm wondering if changing MeasureAlarm1Diff and MeasureAlarm2Diff to calculate the difference from MeasurePrimaryTime instead of MeasureLocalTime would also address the problem; it's not immediately clear to me why both are needed.

Fixed in #272