-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Ticker.h - Too-large timeouts should generate an error, not silently fail (was: big float and unt32_t numbers) #8066
Comments
The allowed ranges of software timer (used in Ticker library) are 5 milliseconds to 1.9 hours or 6870 seconds (timing is in millisecond). Arduino/libraries/Ticker/src/Ticker.cpp Line 48 in da6ec83
See ESP8266 Non-OS SDK API Ref at section 3.1.1. os_timer_arm |
Thank you mobizt. Didn't know about it. Float and uint32_t confused me.
If I wanted to learn Non-OS SDK API, I would not use additional Arduino layer. This should be in the Arduino doc - valid Ticker timer range 5msec..6870947msec (0.005sec..6870.947sec). |
Updated the title a bit. I haven't dug into it, but if Ticker is passed a value it can't actually support it should generate an error somehow, not just silently do nothing so it's somewhere between a bug and enhancement need IMHO. |
@earlephilhower Ticker has all "void" functions. Short of changing all of them, there are two solutions that come to mind:
|
Platform
Settings in IDE
Problem Description
Any Ticker tasks fire OK if time is short (tested up to 60 seconds (60 000ms)). However, when I try to control the brightness after sunset, the time gets big (for example 44944 sec (44 944 000ms)) & the same task no longer start. The code below is not exactly what I have in my project, but close.
MCVE Sketch
The text was updated successfully, but these errors were encountered: