lpcmanager

Smarteh RS485 bus: Rx timeout changed from 50 ms to 20 ms (slaves answer in approx. 10 ms). Timeout is žset outside while loop because select() decreases timeout gradually.
#define DEVICEFILENAME "rightbus"
bzero(&rightReadBuf, sizeof(rightReadBuf_t));
bzero(&rightWriteBuf, sizeof(rightWriteBuf_t));
bzero(&rightBusInit, sizeof(rightBusInit_t));
rightBusInit.common_ticktime__ = common_ticktime__;
#define rightI2CMod (rightBusInit.rightI2CMod)
%(init_code)s
int err;
rightbusfd = rt_dev_open( DEVICEFILENAME, 0);
if (rightbusfd < 0) {
printf("can't open %%s rtdm device, %%s\\n", DEVICEFILENAME,
strerror(-rightbusfd));
return rightbusfd;
}
err = rt_dev_ioctl(rightbusfd, RTSMT_RTIOC_INIT, &rightBusInit);
if (err) {
printf("error while RTSMT_RTIOC_INIT, %%s\\n",
strerror(-err));
rt_dev_close(rightbusfd);
return err;
}