lpcmanager
Clone
Summary
Browse
Changes
Graph
LPCBus: Device bus init was not repeatable across stop/start.
2023-09-07, Edouard Tisserant
5ccb381c307c
LPCBus: Device bus init was not repeatable across stop/start.
In case init happens multiple time, explicit POSIX initialization calls has to be used instead of static initializers.
if(!pthread_mutex_lock(&UART_ReadMutex)){
int prevstate;
if((prevstate=uartDevReadBuf_plc_state) == FULL){
uartDevReadBuf_plc_state = LOCKED;
}
pthread_mutex_unlock(&UART_ReadMutex);
if(prevstate == FULL){
%(retrieve_code)s
/* unlock plc buffer */
uartDevReadBuf_plc_state = EMPTY;
}else{
/* No new data -> no update */
}
}