Closed boraozgen closed 2 years ago
Hi, thanks for the fix. Could you also add a unit test that checks the behaviour?
For the curious, some background: https://arduino.stackexchange.com/questions/12587/how-can-i-handle-the-millis-rollover/12588#12588
Done, I also found another problematic line while writing the tests (L.402) and fixed it too.
If millis overflowed during running state,
now < time_start_
always returned true and hanged the library. This change uses the signed integer trick to handle the overflow situation.For this to work, millis must overflow at 32-bits. I updated the Mbed OS millis implementation to use the latest version to ensure this.