platformio_pre.py

This commit is contained in:
Andrey
2022-01-14 18:15:56 +03:00
parent 0504fa187e
commit a7df53fbfe
34 changed files with 200 additions and 117 deletions

View File

@@ -35,6 +35,9 @@
# include "freertos/FreeRTOS.h"
# include "freertos/task.h"
#endif
#ifdef MICRO_PIP
# include <sys/time.h>
#endif
/*! \class PISystemTime
* @brief System time
@@ -252,12 +255,10 @@ PISystemTime PISystemTime::current(bool precise_but_not_system) {
ullong lt = ullong(sft.dwHighDateTime) * 0x100000000U + ullong(sft.dwLowDateTime);
return PISystemTime(lt / 10000000U, (lt % 10000000U) * 100U);
}
#else
# ifdef MAC_OS
#elif defined(MAC_OS)
mach_timespec_t t_cur;
clock_get_time(__pi_mac_clock, &t_cur);
# else
# ifdef FREERTOS
#elif defined(MICRO_PIP)
timespec t_cur;
timeval tv;
tv.tv_sec = 0;
@@ -265,11 +266,11 @@ PISystemTime PISystemTime::current(bool precise_but_not_system) {
gettimeofday(&tv, NULL);
t_cur.tv_sec = tv.tv_sec;
t_cur.tv_nsec = tv.tv_usec * 1000;
# else
#else
timespec t_cur;
clock_gettime(precise_but_not_system ? CLOCK_MONOTONIC : 0, &t_cur);
# endif
# endif
#endif
#ifndef WINDOWS
return PISystemTime(t_cur.tv_sec, t_cur.tv_nsec);
#endif
}