lpcmanager
Clone
Summary
Browse
Changes
Graph
Fixed random blocking of RS485 task, probably bug of Alchemy API in Xenomai (rt_suspend and rt_resmue ?)
2019-02-05, Edouard Tisserant
e42521549e20
Fixed random blocking of RS485 task, probably bug of Alchemy API in Xenomai (rt_suspend and rt_resmue ?)
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 */
}
}