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