- Library source from AN721SW (cp210xmanufacturing_1.0.tar.gz) - Manufacturing tool source (cp210xsmt) - Builds 64-bit shared library with: make LIB_ARCH=64 - Datasheets and app notes in docs/
30 lines
697 B
C++
30 lines
697 B
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// This is a Linux version of the O/S abstraction layer which implements
|
|
// O/S-dependent primitives and can help write portable apps.
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "OsDep.h"
|
|
#include <time.h>
|
|
#include <unistd.h> // for usleep
|
|
|
|
// Get system tick count in milliseconds
|
|
DWORD GetTickCount()
|
|
{
|
|
DWORD count;
|
|
timespec ts;
|
|
|
|
if (clock_gettime(CLOCK_MONOTONIC, &ts))
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
count = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
|
|
|
return count;
|
|
}
|
|
|
|
void Sleep( DWORD msec)
|
|
{
|
|
usleep( msec * 1000);
|
|
}
|