add delay implementation

This commit is contained in:
Conor Patrick 2019-04-24 11:45:41 -04:00
parent 813eb97d2f
commit 55aadfd78e

View File

@ -272,6 +272,14 @@ void main_loop_delay()
nanosleep(&ts,NULL); nanosleep(&ts,NULL);
} }
void delay(uint32_t ms)
{
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 1000*1000*ms;
nanosleep(&ts,NULL);
}
void heartbeat() void heartbeat()
{ {