#endif // WITH_RTC
-// time from Epoch to the first boot time
+// s_boot_time: time from Epoch to the first boot time
#ifdef WITH_RTC
static RTC_DATA_ATTR struct timeval s_boot_time;
-#else
+#elif defined(WITH_FRC1)
static struct timeval s_boot_time;
#endif
-static _lock_t s_boot_time_lock;
+#if defined(WITH_RTC) || defined(WITH_FRC1)
+static _lock_t s_boot_time_lock;
+#endif
#ifdef WITH_FRC1
#define FRC1_PRESCALER 16
return (clock_t) tv.tv_sec;
}
+#if defined( WITH_FRC1 ) || defined( WITH_RTC )
static uint64_t get_time_since_boot()
{
uint64_t microseconds = 0;
#endif
return microseconds;
}
+#endif // defined( WITH_FRC1 ) || defined( WITH_RTC )
int IRAM_ATTR _gettimeofday_r(struct _reent *r, struct timeval *tv, void *tz)
{
}
return 0;
#else
- __errno_r(r) = ENOSYS;
+ errno = ENOSYS;
return -1;
#endif
}