ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
327 stars 92 forks source link

Possible need to clarify where to use setInterval() function to disable updateNTP() #19

Closed malbrook closed 5 years ago

malbrook commented 5 years ago

I am using eztime as part of a multitask environment and could not understand why it was not working as expected when trying to disable the default updateNTP event. The problem is that in this case you must use the events function first before you try to disable the updateNTP event as part of the events function is to start updateNTP on the first run through even if you had already called setInterval(0). The problem is exacerbated in a multi task environment where the two tasks are running independantly.

Would help I think to make this clear in the documentation.

ropg commented 5 years ago

Thank you for reporting this. Instead of documenting what is essentially a workaround for wrong behaviour, I just made events() not start updateNTP() if the interval has been set to zero. Version 0.7.8 has the fix.