lpcmanager

Parents e825a9e4e899
Children 44bcda8ef9ff
Fixed updating device buffers when PLC app cycle is faster than some device updates.
--- a/LPCBus/MC9_Devices_decl.c Fri Jan 30 14:46:07 2015 +0100
+++ b/LPCBus/MC9_Devices_decl.c Thu Feb 05 12:27:11 2015 +0100
@@ -240,7 +240,7 @@
uartDevReadBuf_t *uartDevReadBuf_drv;
uartDevReadBuf_t *uartDevReadBuf_plc;
/* MC8 compatibility */
-#define uartDevReadBuf (*uartDevReadBuf_drv)
+uartDevReadBuf_t uartDevReadBuf;
/* Buffers for writing data to UART port devices */
typedef char uartDevWriteBuf_t[MAX_UART_DEVICES][UART_BUFSIZE];
@@ -323,6 +323,8 @@
// }
+ memcpy(uartDevReadBuf_drv, &uartDevReadBuf, sizeof(uartDevReadBuf_t));
+
if(!rt_mutex_acquire(&UART_ReadMutex, TM_INFINITE )){
if(uartDevReadBuf_plc_state == EMPTY){
uartDevReadBuf_t *uartDevReadBuf_tmp;