lpcmanager

Fixed random blocking of RS485 task, probably bug of Alchemy API in Xenomai (rt_suspend and rt_resmue ?)
int err;
char *serialdev = "/dev/ttyAPP1";
uartDevWriteBuf_plc_state = EMPTY;
uartDevReadBuf_plc_state = EMPTY;
bzero(&uartDev, sizeof(uartDev));
bzero(&uartDevReadBufA, sizeof(uartDevReadBuf_t));
bzero(&uartDevReadBufB, sizeof(uartDevReadBuf_t));
uartDevReadBuf_drv = &uartDevReadBufA;
uartDevReadBuf_plc = &uartDevReadBufB;
bzero(&uartDevWriteBufA, sizeof(uartDevWriteBuf_t));
bzero(&uartDevWriteBufB, sizeof(uartDevWriteBuf_t));
uartDevWriteBuf_drv = &uartDevWriteBufA;
uartDevWriteBuf_plc = &uartDevWriteBufB;
bzero(&uartCommStatusBuf, sizeof(uartCommStatusBuf));
bzero(&uartCommErrCntBuf, sizeof(uartCommErrCntBuf));
%(init_code)s
UART_fd = openserial(serialdev, uartBaudrate); /* uartBaudrate is initialized from Composer */
if (!UART_fd) {
fprintf(stderr, "Error while initializing %%s.\n", serialdev);
return 1;
}
if(uartBufSize == UART_BUFSIZE_LONG) /* uartBufSize is initialized from Composer */
InitUartPortDevices_longBuffer();
else
InitUartPortDevices_shortBuffer();
UART_task_active = 1;
if(err = pthread_create(&UART_task, NULL, &UART_task_proc, NULL));
return err;