mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
SITL: fixed delay() to account for signal interrupions
when a timer went off we stopped the delay() code
This commit is contained in:
parent
37ab76c9e6
commit
a0e2e69431
@ -59,7 +59,10 @@ long unsigned int micros(void)
|
||||
|
||||
void delayMicroseconds(unsigned usec)
|
||||
{
|
||||
usleep(usec);
|
||||
uint32_t start = micros();
|
||||
while (micros() - start < usec) {
|
||||
usleep(usec - (micros() - start));
|
||||
}
|
||||
}
|
||||
|
||||
void delay(long unsigned msec)
|
||||
|
Loading…
Reference in New Issue
Block a user