mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-21 17:16:34 +03:00
WIP: ESP-IDF Core 3 migration - mbedtls SSL, module library, board configs, MQTT and network updates
This commit is contained in:
@@ -52,7 +52,7 @@ void EMSuart::uart_event_task(void * pvParameters) {
|
||||
uart_read_bytes(EMSUART_NUM, telegram, length, portMAX_DELAY);
|
||||
EMSESP::incoming_telegram(telegram, (uint8_t)(length - 1));
|
||||
} else { // flush buffer up to break
|
||||
uint8_t buf[UART_FIFO_LEN];
|
||||
uint8_t buf[SOC_UART_FIFO_LEN];
|
||||
uart_read_bytes(EMSUART_NUM, buf, length, portMAX_DELAY);
|
||||
}
|
||||
length = 0;
|
||||
@@ -74,12 +74,8 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
.stop_bits = UART_STOP_BITS_1,
|
||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
||||
.rx_flow_ctrl_thresh = 0,
|
||||
.source_clk = UART_SCLK_APB
|
||||
#if ESP_ARDUINO_VERSION_MAJOR >= 3
|
||||
,
|
||||
.flags = {0, 0}
|
||||
#endif
|
||||
};
|
||||
.source_clk = UART_SCLK_APB,
|
||||
.flags = {0}};
|
||||
#if defined(EMSUART_RX_INVERT)
|
||||
inverse_mask |= UART_SIGNAL_RXD_INV;
|
||||
#endif
|
||||
@@ -89,7 +85,7 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
uart_param_config(EMSUART_NUM, &uart_config);
|
||||
uart_set_pin(EMSUART_NUM, tx_gpio, rx_gpio, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
|
||||
uart_set_line_inverse(EMSUART_NUM, inverse_mask);
|
||||
uart_driver_install(EMSUART_NUM, UART_FIFO_LEN + 1, 0, (EMS_MAXBUFFERSIZE + 1) * 2, &uart_queue, 0); // buffer must be > fifo
|
||||
uart_driver_install(EMSUART_NUM, SOC_UART_FIFO_LEN + 1, 0, (EMS_MAXBUFFERSIZE + 1) * 2, &uart_queue, 0); // buffer must be > fifo
|
||||
uart_set_rx_full_threshold(EMSUART_NUM, 1);
|
||||
uart_set_rx_timeout(EMSUART_NUM, 0); // disable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user