ESPHome 2025.5.1
Loading...
Searching...
No Matches
core.cpp
Go to the documentation of this file.
1#ifdef USE_RP2040
2
3#include "core.h"
4#include "esphome/core/hal.h"
6
7#include "hardware/watchdog.h"
8
9namespace esphome {
10
11void IRAM_ATTR HOT yield() { ::yield(); }
12uint32_t IRAM_ATTR HOT millis() { return ::millis(); }
13void IRAM_ATTR HOT delay(uint32_t ms) { ::delay(ms); }
14uint32_t IRAM_ATTR HOT micros() { return ::micros(); }
15void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { delay_microseconds_safe(us); }
16void arch_restart() {
17 watchdog_reboot(0, 0, 10);
18 while (1) {
19 continue;
20 }
21}
22void arch_init() { watchdog_enable(0x7fffff, false); }
23void IRAM_ATTR HOT arch_feed_wdt() { watchdog_update(); }
24
25uint8_t progmem_read_byte(const uint8_t *addr) {
26 return pgm_read_byte(addr); // NOLINT
27}
28uint32_t IRAM_ATTR HOT arch_get_cpu_cycle_count() { return ulMainGetRunTimeCounterValue(); }
29uint32_t arch_get_cpu_freq_hz() { return RP2040::f_cpu(); }
30
31} // namespace esphome
32
33#endif // USE_RP2040
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint32_t arch_get_cpu_cycle_count()
Definition core.cpp:60
void arch_init()
Definition core.cpp:40
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
Definition core.cpp:31
void IRAM_ATTR HOT yield()
Definition core.cpp:27
uint32_t arch_get_cpu_freq_hz()
Definition core.cpp:64
uint32_t IRAM_ATTR HOT micros()
Definition core.cpp:30
void IRAM_ATTR HOT delay_microseconds_safe(uint32_t us)
Delay for the given amount of microseconds, possibly yielding to other processes during the wait.
Definition helpers.cpp:773
void IRAM_ATTR HOT arch_feed_wdt()
Definition core.cpp:56
void IRAM_ATTR HOT delay(uint32_t ms)
Definition core.cpp:29
uint32_t IRAM_ATTR HOT millis()
Definition core.cpp:28
void arch_restart()
Definition core.cpp:32
uint8_t progmem_read_byte(const uint8_t *addr)
Definition core.cpp:58
unsigned long ulMainGetRunTimeCounterValue()