Fix potential bug with wait loops

This commit is contained in:
Pascal Langer
2020-12-10 16:52:34 +01:00
parent 2b0f663482
commit ebb8a33c1a
5 changed files with 7 additions and 7 deletions

View File

@@ -115,7 +115,7 @@ void delayMilliseconds(unsigned long ms)
uint16_t lms = ms ;
while (lms > 0) {
if (((uint16_t)micros() - start) >= 1000) {
if ((uint16_t)((uint16_t)micros() - start) >= 1000) {
lms--;
start += 1000;
}