diff --git a/esphome/components/zephyr/core.cpp b/esphome/components/zephyr/core.cpp index 3ab29e5adc..a2d185221e 100644 --- a/esphome/components/zephyr/core.cpp +++ b/esphome/components/zephyr/core.cpp @@ -1,4 +1,4 @@ -#ifdef USE_ZEPHYR +#if 1 #include #include @@ -11,8 +11,9 @@ const device *wdt = nullptr; void yield() { ::k_yield(); } uint32_t millis() { return k_ticks_to_ms_floor32(k_uptime_ticks()); } -void delay(uint32_t ms) { ::k_msleep(ms); } uint32_t micros() { return k_ticks_to_us_floor32(k_uptime_ticks()); } +void delayMicroseconds(uint32_t us) { ::k_usleep(us); } +void delay(uint32_t ms) { ::k_msleep(ms); } void arch_init() { wdt = DEVICE_DT_GET(DT_ALIAS(watchdog0)); @@ -35,6 +36,9 @@ void arch_feed_wdt() { } void arch_restart() { sys_reboot(SYS_REBOOT_COLD); } +uint32_t arch_get_cpu_cycle_count() { return k_cycle_get_32(); } +uint32_t arch_get_cpu_freq_hz() { return sys_clock_hw_cycles_per_sec(); } +uint8_t progmem_read_byte(const uint8_t *addr) { return *addr; } } // namespace esphome