Fix the delay condition bug when overflow

The original expression will cause bug when overflow.
This commit is contained in:
Qi Wenmin 2018-01-10 12:00:53 +08:00
parent fda398046e
commit 7ef9c29fa8
1 changed files with 1 additions and 1 deletions

View File

@ -275,7 +275,7 @@ unsigned long delayBeforeTime = 0;
byte delay_background(unsigned delayTime, byte fromType){ //fromType : 4 autoCWKey -> Check Paddle
delayBeforeTime = millis();
while (millis() <= delayBeforeTime + delayTime) {
while (millis() - delayBeforeTime <= delayTime) {
if (fromType == 4)
{