--- a/LPCBus/SOM_Devices_decl.c Thu Sep 25 15:02:21 2025 +0200
+++ b/LPCBus/SOM_Devices_decl.c Thu Oct 16 15:05:38 2025 +0200
@@ -79,7 +79,6 @@
#define MAX_UART_DEVICES 32
#define UART_BUFSIZE_SHORT 26 /* UART bus read & write buffer size - short buffer for LPC-2 */
#define UART_BUFSIZE_LONG 48 /* UART bus read & write buffer size - long buffer for LHC-2 */
-#define UART_RETRY_NUM 0
char uartBufSize = UART_BUFSIZE_SHORT; /* Smarteh uart bus: buffer size */
unsigned long uartBaudrate = 19200; /* Smarteh uart bus: baudrate */
@@ -113,7 +112,6 @@
/* Buffers for communication statuses with UART port devices */
/* 2D arrays due to compatibility with Composer (LpcSmartehIDE) */
-char uartCommErrCntBuf [MAX_UART_DEVICES][1];
char uartCommStatusBuf[MAX_UART_DEVICES][1];
/* Function interface definition for modules on UART (RS485) bus */
@@ -216,18 +214,12 @@
// Check communication status:
+ // Set error immediatelly on first fail, + // error counting/handling can be done in PLC app
uartCommStatusBuf[i][0] = TRUE;
- uartCommErrCntBuf[i][0] = 0;
- if(uartCommErrCntBuf[i][0] < UART_RETRY_NUM)
- uartCommErrCntBuf[i][0]++;
- uartCommStatusBuf[i][0] = FALSE;
+ uartCommStatusBuf[i][0] = FALSE; // If timer is enabled, reset it's value,
// otherwise keep it disabled
--- a/LPCBus/SOM_Devices_init.c Thu Sep 25 15:02:21 2025 +0200
+++ b/LPCBus/SOM_Devices_init.c Thu Oct 16 15:05:38 2025 +0200
@@ -20,7 +20,6 @@
uartDevWriteBuf_plc = &uartDevWriteBufB;
bzero(&uartCommStatusBuf, sizeof(uartCommStatusBuf));
-bzero(&uartCommErrCntBuf, sizeof(uartCommErrCntBuf));
bzero(&uartPortTim, sizeof(commTimer));
pthread_mutex_init(&UART_WriteMutex, NULL);