15void HOT
yield() { ::sched_yield(); }
18 clock_gettime(CLOCK_MONOTONIC, &spec);
19 time_t seconds = spec.tv_sec;
20 uint32_t ms = round(spec.tv_nsec / 1e6);
21 return ((uint32_t) seconds) * 1000U + ms;
25 clock_gettime(CLOCK_MONOTONIC, &spec);
26 return static_cast<uint64_t
>(spec.tv_sec) * 1000ULL +
static_cast<uint64_t
>(spec.tv_nsec) / 1000000ULL;
28void HOT
delay(uint32_t ms) {
30 ts.tv_sec = ms / 1000;
31 ts.tv_nsec = (ms % 1000) * 1000000;
34 res = nanosleep(&ts, &ts);
35 }
while (res != 0 && errno == EINTR);
39 clock_gettime(CLOCK_MONOTONIC, &spec);
40 time_t seconds = spec.tv_sec;
41 uint32_t us = round(spec.tv_nsec / 1e3);
42 return ((uint32_t) seconds) * 1000000U + us;
46 ts.tv_sec = us / 1000000U;
47 ts.tv_nsec = (us % 1000000U) * 1000U;
50 res = nanosleep(&ts, &ts);
51 }
while (res != 0 && errno == EINTR);
65 clock_gettime(CLOCK_MONOTONIC, &spec);
66 time_t seconds = spec.tv_sec;
68 return ((uint32_t) seconds) * 1000000000U + us;
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()
uint16_t progmem_read_uint16(const uint16_t *addr)
void HOT delay(uint32_t ms)
uint32_t IRAM_ATTR HOT millis()
uint8_t progmem_read_byte(const uint8_t *addr)