From 4d06bdfc04755585a87bfbb07b384b4aef333cf2 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Fri, 29 Jun 2012 15:06:50 +0200 Subject: [PATCH] PiOS.posix: bugfix to POSIX pios_delay implementation --- flight/PiOS.posix/posix/pios_delay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/PiOS.posix/posix/pios_delay.c b/flight/PiOS.posix/posix/pios_delay.c index 386e2bb2f..6cdeabd0d 100644 --- a/flight/PiOS.posix/posix/pios_delay.c +++ b/flight/PiOS.posix/posix/pios_delay.c @@ -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; } //}