lpcmanager
Clone
Summary
Browse
Changes
Graph
Fixed updating device buffers when PLC app cycle is faster than some device updates.
2015-02-05, Edouard Tisserant
164f30d8a9ab
Fixed updating device buffers when PLC app cycle is faster than some device updates.
if(!rt_mutex_acquire(&UART_ReadMutex, TM_INFINITE )){
int prevstate;
if((prevstate=uartDevReadBuf_plc_state) == FULL){
uartDevReadBuf_plc_state = LOCKED;
}
rt_mutex_release(&UART_ReadMutex);
if(prevstate == FULL){
%(retrieve_code)s
/* unlock plc buffer */
uartDevReadBuf_plc_state = EMPTY;
}else{
/* No new data -> no update */
}
}