diff --git a/src/core/system.cpp b/src/core/system.cpp index 6861a063a..202767dca 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -34,25 +34,6 @@ #include "../test/test.h" #endif -#ifndef EMSESP_STANDALONE -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "../esp32/rom/rtc.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "../esp32s2/rom/rtc.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "../esp32c3/rom/rtc.h" -#elif CONFIG_IDF_TARGET_ESP32S3 -#include "../esp32s3/rom/rtc.h" -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#else // ESP32 Before IDF 4.0 -#include "../rom/rtc.h" -#endif -#include -#endif - #ifndef NO_TLS_SUPPORT #define ENABLE_SMTP #define USE_ESP_SSLCLIENT @@ -63,6 +44,7 @@ #endif #ifndef EMSESP_STANDALONE +#include #include "esp_efuse.h" #endif @@ -2642,7 +2624,7 @@ bool System::command_restart(const char * value, const int8_t id) { std::string System::reset_reason(uint8_t cpu) const { #ifndef EMSESP_STANDALONE - switch (rtc_get_reset_reason(cpu)) { + switch (esp_rom_get_reset_reason(cpu)) { case 1: return ("Power on reset"); // case 2 :reset pin not on esp32 diff --git a/src/uart/emsuart_esp32.cpp b/src/uart/emsuart_esp32.cpp index bc59415b3..1f47d70b2 100644 --- a/src/uart/emsuart_esp32.cpp +++ b/src/uart/emsuart_esp32.cpp @@ -68,6 +68,14 @@ void EMSuart::uart_event_task(void * pvParameters) { // initialize UART driver void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t tx_gpio) { if (tx_mode_ == EMS_TXMODE_INIT) { +#if CONFIG_IDF_TARGET_ESP32C6 + uart_config_t uart_config = {.baud_rate = EMSUART_BAUD, + .data_bits = UART_DATA_8_BITS, + .parity = UART_PARITY_DISABLE, + .stop_bits = UART_STOP_BITS_1, + .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, + .rx_flow_ctrl_thresh = 0}; +#else uart_config_t uart_config = {.baud_rate = EMSUART_BAUD, .data_bits = UART_DATA_8_BITS, .parity = UART_PARITY_DISABLE, @@ -76,6 +84,7 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t .rx_flow_ctrl_thresh = 0, .source_clk = UART_SCLK_APB, .flags = {0}}; +#endif #if defined(EMSUART_RX_INVERT) inverse_mask |= UART_SIGNAL_RXD_INV; #endif