packages/devel/lpc21isp/patches/120-nanosleep.patch
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00

12 lines
381 B
Diff

--- a/lpc21isp.c
+++ b/lpc21isp.c
@@ -1130,7 +1130,8 @@ void ClearSerialPortBuffers(ISP_ENVIRONM
*/
void Sleep(unsigned long MilliSeconds)
{
- usleep(MilliSeconds*1000); //convert to microseconds
+ struct timespec m = { MilliSeconds / 1000 , (MilliSeconds % 1000 ) * 1000 * 1000};
+ nanosleep(&m, &m); //convert to nanoseconds
}
#endif // defined COMPILE_FOR_LINUX