mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
PiOS.posix: bugfix to POSIX pios_delay implementation
This commit is contained in:
parent
bf0bea49da
commit
4d06bdfc04
@ -64,7 +64,7 @@ int32_t PIOS_DELAY_WaituS(uint32_t uS)
|
||||
static struct timespec wait,rest;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=1000*uS;
|
||||
while (!nanosleep(&wait,&rest)) {
|
||||
while (nanosleep(&wait,&rest)!=0) {
|
||||
wait=rest;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ int32_t PIOS_DELAY_WaitmS(uint32_t mS)
|
||||
static struct timespec wait,rest;
|
||||
wait.tv_sec=mS/1000;
|
||||
wait.tv_nsec=(mS%1000)*1000000;
|
||||
while (!nanosleep(&wait,&rest)) {
|
||||
while (nanosleep(&wait,&rest)!=0) {
|
||||
wait=rest;
|
||||
}
|
||||
//}
|
||||
|
Loading…
Reference in New Issue
Block a user