From 19a9a46b2c8c942e910f1a33ead152ed7a66ba24 Mon Sep 17 00:00:00 2001 From: bogd Date: Tue, 1 Apr 2025 11:53:45 +0200 Subject: [PATCH] fixed serial port access while port is disabled --- src/SerialPort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SerialPort.c b/src/SerialPort.c index 7d4d4a6..b86dbb0 100644 --- a/src/SerialPort.c +++ b/src/SerialPort.c @@ -34,6 +34,7 @@ #include #include #include +#include "SysConfiguration.h" #include "webguiapp.h" #include "driver/gpio.h" @@ -64,6 +65,8 @@ static char rxbuf[CONFIG_WEBGUIAPP_UART_BUF_SIZE]; esp_err_t TransmitSerialPort(char *data, int ln) { + if(!GetSysConf()->serialSettings.Flags.IsSerialEnabled) + return ESP_ERR_NOT_ALLOWED; UART_DATA_SEND_STRUCT DSS; char *buf = malloc(ln); if (!buf)