HAL_Linux: fixed stopped clock delay

This commit is contained in:
Andrew Tridgell 2014-01-05 11:39:29 +11:00
parent 9b53db66cb
commit 78ff078988
1 changed files with 4 additions and 3 deletions

View File

@ -87,8 +87,10 @@ void LinuxScheduler::_microsleep(uint32_t usec)
void LinuxScheduler::delay(uint16_t ms)
{
uint32_t old_stop = stopped_clock_ms;
stopped_clock_ms = 0;
if (stopped_clock_ms) {
stopped_clock_ms += ms;
return;
}
uint32_t start = millis();
while ((millis() - start) < ms) {
@ -100,7 +102,6 @@ void LinuxScheduler::delay(uint16_t ms)
}
}
}
stopped_clock_ms = old_stop;
}
uint32_t LinuxScheduler::millis()