ESPHome  2024.10.2
core.cpp
Go to the documentation of this file.
1 #ifdef USE_LIBRETINY
2 
3 #include "core.h"
4 #include "esphome/core/defines.h"
5 #include "esphome/core/hal.h"
6 #include "esphome/core/helpers.h"
7 #include "preferences.h"
8 
9 void setup();
10 void loop();
11 
12 namespace esphome {
13 
14 void IRAM_ATTR HOT yield() { ::yield(); }
15 uint32_t IRAM_ATTR HOT millis() { return ::millis(); }
16 uint32_t IRAM_ATTR HOT micros() { return ::micros(); }
17 void IRAM_ATTR HOT delay(uint32_t ms) { ::delay(ms); }
18 void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { ::delayMicroseconds(us); }
19 
20 void arch_init() {
22  lt_wdt_enable(10000L);
23 #if LT_GPIO_RECOVER
24  lt_gpio_recover();
25 #endif
26 }
27 
28 void arch_restart() {
29  lt_reboot();
30  while (1) {
31  }
32 }
33 void IRAM_ATTR HOT arch_feed_wdt() { lt_wdt_feed(); }
34 uint32_t arch_get_cpu_cycle_count() { return lt_cpu_get_cycle_count(); }
35 uint32_t arch_get_cpu_freq_hz() { return lt_cpu_get_freq(); }
36 uint8_t progmem_read_byte(const uint8_t *addr) { return *addr; }
37 
38 } // namespace esphome
39 
40 #endif // USE_LIBRETINY
void setup()
void loop()
void IRAM_ATTR HOT arch_feed_wdt()
Definition: core.cpp:53
uint32_t IRAM_ATTR HOT micros()
Definition: core.cpp:27
uint32_t IRAM_ATTR HOT millis()
Definition: core.cpp:25
uint32_t arch_get_cpu_freq_hz()
Definition: core.cpp:61
void arch_restart()
Definition: core.cpp:29
uint8_t progmem_read_byte(const uint8_t *addr)
Definition: core.cpp:55
void IRAM_ATTR HOT yield()
Definition: core.cpp:24
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
Definition: core.cpp:28
void arch_init()
Definition: core.cpp:37
uint32_t arch_get_cpu_cycle_count()
Definition: core.cpp:57
void IRAM_ATTR HOT delay(uint32_t ms)
Definition: core.cpp:26