diff --git a/utility/MRAA/compatibility.cpp b/utility/MRAA/compatibility.cpp index efed1e7b..1b1eac31 100644 --- a/utility/MRAA/compatibility.cpp +++ b/utility/MRAA/compatibility.cpp @@ -19,7 +19,7 @@ void __usleep(int microsec) { struct timespec req; // = {0}; req.tv_sec = (time_t)microsec / 1000000; - req.tv_nsec = (microsec / 1000000) * 1000; + req.tv_nsec = (microsec % 1000000) * 1000; clock_nanosleep(CLOCK_REALTIME, 0, &req, NULL); } diff --git a/utility/SPIDEV/compatibility.cpp b/utility/SPIDEV/compatibility.cpp index 6b96f658..20107d85 100644 --- a/utility/SPIDEV/compatibility.cpp +++ b/utility/SPIDEV/compatibility.cpp @@ -23,7 +23,7 @@ void __usleep(int microsec) { struct timespec req; // = {0}; req.tv_sec = (time_t)microsec / 1000000; - req.tv_nsec = (microsec / 1000000) * 1000; + req.tv_nsec = (microsec % 1000000) * 1000; //nanosleep(&req, (struct timespec *)NULL); clock_nanosleep(CLOCK_REALTIME, 0, &req, NULL); }