fixed serial port access while port is disabled

This commit is contained in:
Bogdan Pilyugin 2025-04-01 11:53:45 +02:00
parent 27e87e4083
commit 19a9a46b2c

View File

@ -34,6 +34,7 @@
#include <sdkconfig.h>
#include <stdlib.h>
#include <string.h>
#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)