Try MICRO_PIP fixes via opencode
This commit is contained in:
@@ -55,8 +55,21 @@ void piUSleep(int usecs) {
|
||||
# ifdef FREERTOS
|
||||
vTaskDelay(usecs / 1000 / portTICK_PERIOD_MS);
|
||||
# else
|
||||
# ifdef MICRO_PIP
|
||||
if (usecs > 0) {
|
||||
struct timeval start;
|
||||
gettimeofday(&start, nullptr);
|
||||
long long elapsed = 0;
|
||||
while (elapsed < usecs) {
|
||||
struct timeval now;
|
||||
gettimeofday(&now, nullptr);
|
||||
elapsed = (now.tv_sec - start.tv_sec) * 1000000LL + (now.tv_usec - start.tv_usec);
|
||||
}
|
||||
}
|
||||
# else
|
||||
usecs -= PISystemTests::usleep_offset_us;
|
||||
if (usecs > 0) usleep(usecs);
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -55,12 +55,16 @@ public:
|
||||
}
|
||||
#ifdef MICRO_PIP
|
||||
PIString typeName() const final {
|
||||
static PIString ret(PIVariant(T()).typeName());
|
||||
static PIString ret(PIVariant::fromValue<T>(T()).typeName());
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
PIString typeName() const final {
|
||||
#if defined(__GXX_RTTI__) || defined(__RTTI__)
|
||||
static PIString ret(typeid(T).name());
|
||||
#else
|
||||
static PIString ret("unknown");
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user