15volatile sig_atomic_t s_signal_received = 0;
16void signal_handler(
int signal) { s_signal_received = signal; }
21void HOT
yield() { ::sched_yield(); }
24 clock_gettime(CLOCK_MONOTONIC, &spec);
25 time_t seconds = spec.tv_sec;
26 uint32_t ms = round(spec.tv_nsec / 1e6);
27 return ((
uint32_t) seconds) * 1000U + ms;
31 clock_gettime(CLOCK_MONOTONIC, &spec);
32 return static_cast<uint64_t
>(spec.tv_sec) * 1000ULL +
static_cast<uint64_t
>(spec.tv_nsec) / 1000000ULL;
36 ts.tv_sec = ms / 1000;
37 ts.tv_nsec = (ms % 1000) * 1000000;
40 res = nanosleep(&ts, &ts);
41 }
while (res != 0 && errno == EINTR);
45 clock_gettime(CLOCK_MONOTONIC, &spec);
46 time_t seconds = spec.tv_sec;
47 uint32_t us = round(spec.tv_nsec / 1e3);
48 return ((
uint32_t) seconds) * 1000000U + us;
52 ts.tv_sec = us / 1000000U;
53 ts.tv_nsec = (us % 1000000U) * 1000U;
56 res = nanosleep(&ts, &ts);
57 }
while (res != 0 && errno == EINTR);
69 clock_gettime(CLOCK_MONOTONIC, &spec);
70 time_t seconds = spec.tv_sec;
72 return ((
uint32_t) seconds) * 1000000000U + us;
82 std::signal(SIGINT, signal_handler);
83 std::signal(SIGTERM, signal_handler);
87 while (s_signal_received == 0) {
void run_safe_shutdown_hooks()
Providing packet encoding functions for exchanging data with a remote host.
uint32_t arch_get_cpu_cycle_count()
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
uint32_t arch_get_cpu_freq_hz()
uint32_t IRAM_ATTR HOT micros()
void HOT delay(uint32_t ms)
uint32_t IRAM_ATTR HOT millis()
Application App
Global storage of Application pointer - only one Application can exist.