--- a/LPCBus/SOM_Devices_decl.c Wed Aug 30 12:04:45 2023 +0200
+++ b/LPCBus/SOM_Devices_decl.c Thu Sep 07 11:25:03 2023 +0200
@@ -124,11 +124,11 @@
static commTimer uartPortTim[MAX_UART_DEVICES];
static pthread_t UART_task;
-static pthread_mutex_t UART_WriteMutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t UART_ReadMutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t UART_WakeCondLock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t UART_WakeCond = PTHREAD_COND_INITIALIZER;
-static int UART_WakeCondValue = 0;
+static pthread_mutex_t UART_WriteMutex; +static pthread_mutex_t UART_ReadMutex; +static pthread_mutex_t UART_WakeCondLock; +static pthread_cond_t UART_WakeCond; +static int UART_WakeCondValue; static int UART_task_active;
void* UART_task_proc(void *arg)
--- a/LPCBus/SOM_Devices_init.c Wed Aug 30 12:04:45 2023 +0200
+++ b/LPCBus/SOM_Devices_init.c Thu Sep 07 11:25:03 2023 +0200
@@ -7,6 +7,7 @@
uartDevWriteBuf_plc_state = EMPTY;
uartDevReadBuf_plc_state = EMPTY;
bzero(&uartDev, sizeof(uartDev));
+uartDevNum = MAX_UART_DEVICES; bzero(&uartDevReadBufA, sizeof(uartDevReadBuf_t));
bzero(&uartDevReadBufB, sizeof(uartDevReadBuf_t));
@@ -20,6 +21,14 @@
bzero(&uartCommStatusBuf, sizeof(uartCommStatusBuf));
bzero(&uartCommErrCntBuf, sizeof(uartCommErrCntBuf));
+bzero(&uartPortTim, sizeof(commTimer)); +pthread_mutex_init(&UART_WriteMutex, NULL); +pthread_mutex_init(&UART_ReadMutex, NULL); +pthread_mutex_init(&UART_WakeCondLock, NULL); +pthread_cond_init(&UART_WakeCond, NULL); @@ -61,9 +70,6 @@
if(err = pthread_create(&UART_task, &attr, &UART_task_proc, NULL));