lpcmanager

Smarteh 485: slave address of RX buffer must match the address of sent TX buffer in order to be accepted. If reception is not successful data is not copied to beremiz buffer (memcpy()).
#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;
}