mirror of https://github.com/arendst/Tasmota.git
Prep serial IDF 5.2 support
This commit is contained in:
parent
843dd17aec
commit
04a6d5513b
|
@ -150,7 +150,7 @@ void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) {
|
|||
|
||||
#ifdef ESP32
|
||||
bool TasmotaSerial::freeUart(void) {
|
||||
for (uint32_t i = SOC_UART_NUM -1; i >= 0; i--) {
|
||||
for (uint32_t i = SOC_UART_HP_NUM -1; i >= 0; i--) {
|
||||
if (0 == bitRead(tasmota_serial_uart_bitmap, i)) {
|
||||
m_uart = uart_port_t(i);
|
||||
bitSet(tasmota_serial_uart_bitmap, m_uart);
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
|
||||
#ifdef ESP32
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
// IDF 5.2 has changed counting UART channels, SOC_UART_NUM includes now LP UARTS too for ESP32-C6 and -P4
|
||||
#ifndef SOC_UART_HP_NUM
|
||||
#define SOC_UART_HP_NUM SOC_UART_NUM // Set new define SOC_UART_HP_NUM in pre IDF 5.2 to SOC_UART_NUM
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
class TasmotaSerial : public Stream {
|
||||
|
|
|
@ -191,11 +191,5 @@ typedef int SerConfu8;
|
|||
#define LCD_CAM_LCD_UPDATE_REG LCD_CAM_LCD_UPDATE_M
|
||||
#endif // LCD_CAM_LCD_UPDATE_M
|
||||
|
||||
// IDF 5.2 has changed counting UART channels, SOC_UART_NUM includes now LP UARTS too
|
||||
#ifdef SOC_UART_HP_NUM
|
||||
#undef SOC_UART_NUM
|
||||
#define SOC_UART_NUM SOC_UART_HP_NUM
|
||||
#endif
|
||||
|
||||
#endif // ESP32
|
||||
#endif // __ESP8266TOESP32_H__
|
||||
|
|
|
@ -3125,7 +3125,7 @@ void SML_Init(void) {
|
|||
uint16_t memory = 0;
|
||||
|
||||
#ifdef ESP32
|
||||
uint32_t uart_index = SOC_UART_NUM - 1;
|
||||
uint32_t uart_index = SOC_UART_HP_NUM - 1;
|
||||
#endif
|
||||
|
||||
sml_globs.sml_send_blocks = 0;
|
||||
|
|
Loading…
Reference in New Issue