Current Lua downloadable firmware will be posted here

User avatar
By stevemac00
#46622 I need a tmr with large values to accommodate a necessary off function for relay.

This comment is in https://nodemcu.readthedocs.io/en/dev/en/modules/tmr/
timer interval in milliseconds. Maximum value is 12884901. In SDKs <= 1.5.0 values >6871948 result in incorrect behaviour.

However, when I downloaded 1.5.1 dev and built/flashed, I found the "bug" is still there.
For example, this code finishes immediately:
Code: Select alltmr.alarm(0,12600000,0,function() print("\nDone\n") end)

Can anyone tell me the status of this issue? ( I realize I can work around with breaking it up into multiples with intermediate functions but I'd like to clean up if I can.)
User avatar
By stevemac00
#46863 Here's what I empirically determined:
Internally the mS value is multiplied by 1000 to be uS. This means a 32-bit signed integer has a maximum value of 0X7FFFFFF / 1000 or 2147483. This doesn't seem to be documented anywhere so there's a chance I'm incorrect . However, I'm sure this statement in the documentation is wrong:
interval_ms timer interval in milliseconds. Maximum value is 12884901. In SDKs <= 1.5.0 values >6871948 result in incorrect behaviour.
User avatar
By dnc40085
#47027
interval_ms timer interval in milliseconds. Maximum value is 12884901. In SDKs <= 1.5.0 values >6871948 result in incorrect behaviour.

stevemac00 is right. the documentation has a typo, it should be " In SDKs >= 1.5.0" instead of " In SDKs <= 1.5.0"