5 #include "preferences.h" 14 void IRAM_ATTR HOT
yield() { ::sched_yield(); }
15 uint32_t IRAM_ATTR HOT
millis() {
17 clock_gettime(CLOCK_MONOTONIC, &spec);
18 time_t seconds = spec.tv_sec;
19 uint32_t ms = round(spec.tv_nsec / 1e6);
20 return ((uint32_t) seconds) * 1000U + ms;
22 void IRAM_ATTR HOT
delay(uint32_t ms) {
24 ts.tv_sec = ms / 1000;
25 ts.tv_nsec = (ms % 1000) * 1000000;
28 res = nanosleep(&ts, &ts);
29 }
while (res != 0 && errno == EINTR);
31 uint32_t IRAM_ATTR HOT
micros() {
33 clock_gettime(CLOCK_MONOTONIC, &spec);
34 time_t seconds = spec.tv_sec;
35 uint32_t us = round(spec.tv_nsec / 1e3);
36 return ((uint32_t) seconds) * 1000000U + us;
40 ts.tv_sec = us / 1000000U;
41 ts.tv_nsec = (us % 1000000U) * 1000U;
44 res = nanosleep(&ts, &ts);
45 }
while (res != 0 && errno == EINTR);
58 clock_gettime(CLOCK_MONOTONIC, &spec);
59 time_t seconds = spec.tv_sec;
60 uint32_t us = spec.tv_nsec;
61 return ((uint32_t) seconds) * 1000000000U + us;
void IRAM_ATTR HOT arch_feed_wdt()
uint32_t IRAM_ATTR HOT micros()
uint32_t IRAM_ATTR HOT millis()
uint32_t arch_get_cpu_freq_hz()
uint8_t progmem_read_byte(const uint8_t *addr)
void IRAM_ATTR HOT yield()
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
uint32_t arch_get_cpu_cycle_count()
void IRAM_ATTR HOT delay(uint32_t ms)