Try MICRO_PIP fixes via opencode

This commit is contained in:
2026-03-29 11:21:12 +03:00
parent c60a682279
commit 15f90d9e17
8 changed files with 251 additions and 13 deletions

View File

@@ -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
}

View File

@@ -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