Improve build process for Linux
This commit is contained in:
@@ -51,6 +51,7 @@ char *ltoa(long value, char* result, int base);
|
||||
char *ultoa(long num, char *str, int radix);
|
||||
char *utoa(int num, char *str, int radix);
|
||||
char *dtostrf(float f, int width, int decimals, char *result);
|
||||
void delay(unsigned int millis);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "Arduino.h"
|
||||
|
||||
/**
|
||||
@@ -175,3 +176,12 @@ char *dtostrf(float f, int width, int decimals, char *result)
|
||||
sprintf(result,"%*.*f", width, decimals, f);
|
||||
return result;
|
||||
}
|
||||
|
||||
void delay(unsigned int millis)
|
||||
{
|
||||
struct timespec sleeper;
|
||||
|
||||
sleeper.tv_sec = (time_t)(millis / 1000);
|
||||
sleeper.tv_nsec = (long)(millis % 1000) * 1000000;
|
||||
nanosleep(&sleeper, NULL);
|
||||
}
|
||||
Reference in New Issue
Block a user