Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeAlarmsClass::create: paranoia check avoids creating alarms before system time is set #48

Open
KollegeJens opened this issue Dec 4, 2019 · 1 comment

Comments

@KollegeJens
Copy link

Description

Time check in TimeAlarmsClass::create avoids that alarms can be created before system time is set

System time has at least to elapse 1 year (1.1.1971) before alarms can be added. I don't see a reason not to allow this. This one is required for setting up a alarm schedule at startup in combination with system time is setup later on (ie. as soon as NTP server is reachable)

if ( ! ( (dtIsAlarm(alarmType) && **now() < SECS_PER_YEAR**) || (dtUseAbsoluteValue(alarmType) && (value == 0)) ) ) {

Steps To Reproduce Problem

Alarm.alarmRepeat(1, handle);
setTime(0);

Hardware & Software

TimeAlarms 1.5.0

@tonilopezmr
Copy link

I'm having the same problem, but I set alarms after setTime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants