--- a/LPCBus/MC9_OnBoard_cleanup.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_OnBoard_cleanup.c Fri Mar 23 11:30:50 2018 +0100
@@ -8,7 +8,7 @@
- rt_dev_close(onboardbusfd);
--- a/LPCBus/MC9_OnBoard_init.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_OnBoard_init.c Fri Mar 23 11:30:50 2018 +0100
@@ -1,4 +1,4 @@
-#define ONBOARDDEVFILENAME "onBoard"
+#define ONBOARDDEVFILENAME "/dev/rtdm/onBoard" @@ -53,16 +53,16 @@
switch(onBoardDev[i][1]) {
- onboardbusfd = rt_dev_open(ONBOARDDEVFILENAME, 0);
+ onboardbusfd = open(ONBOARDDEVFILENAME, 0); printf("can't open %%s rtdm device, %%s\n", ONBOARDDEVFILENAME,
strerror(-onboardbusfd));
- err = rt_dev_ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_INIT, &onBoardBusInit);
+ err = ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_INIT, &onBoardBusInit); printf("error while RTSMT_ONBOARD_RTIOC_INIT, %%s\n", strerror(-err));
- rt_dev_close(onboardbusfd);
--- a/LPCBus/MC9_OnBoard_publish.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_OnBoard_publish.c Fri Mar 23 11:30:50 2018 +0100
@@ -8,5 +8,5 @@
- rt_dev_ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_WRITE, &onBoardWriteBuf);
+ ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_WRITE, &onBoardWriteBuf); --- a/LPCBus/MC9_OnBoard_retrieve.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_OnBoard_retrieve.c Fri Mar 23 11:30:50 2018 +0100
@@ -2,7 +2,7 @@
- rt_dev_ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_READ, &onBoardReadBuf);
+ ioctl(onboardbusfd, RTSMT_ONBOARD_RTIOC_READ, &onBoardReadBuf); --- a/LPCBus/MC9_Right_cleanup.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_Right_cleanup.c Fri Mar 23 11:30:50 2018 +0100
@@ -1,1 +1,1 @@
-rt_dev_close(rightbusfd);
--- a/LPCBus/MC9_Right_init.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_Right_init.c Fri Mar 23 11:30:50 2018 +0100
@@ -1,4 +1,4 @@
-#define DEVICEFILENAME "rightbus"
+#define DEVICEFILENAME "/dev/rtdm/rightbus" bzero(&rightReadBuf, sizeof(rightReadBuf_t));
bzero(&rightWriteBuf, sizeof(rightWriteBuf_t));
@@ -10,17 +10,17 @@
-rightbusfd = rt_dev_open( DEVICEFILENAME, 0);
+rightbusfd = open( DEVICEFILENAME, 0); printf("can't open %%s rtdm device, %%s\\n", DEVICEFILENAME,
-err = rt_dev_ioctl(rightbusfd, RTSMT_RTIOC_INIT, &rightBusInit);
+err = ioctl(rightbusfd, RTSMT_RTIOC_INIT, &rightBusInit); printf("error while RTSMT_RTIOC_INIT, %%s\\n",
- rt_dev_close(rightbusfd);
--- a/LPCBus/MC9_Right_publish.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_Right_publish.c Fri Mar 23 11:30:50 2018 +0100
@@ -1,2 +1,2 @@
-rt_dev_ioctl(rightbusfd, RTSMT_RTIOC_WRITE, &rightWriteBuf);
+ioctl(rightbusfd, RTSMT_RTIOC_WRITE, &rightWriteBuf); --- a/LPCBus/MC9_Right_retrieve.c Thu Mar 22 13:48:24 2018 +0100
+++ b/LPCBus/MC9_Right_retrieve.c Fri Mar 23 11:30:50 2018 +0100
@@ -1,2 +1,2 @@
-rt_dev_ioctl(rightbusfd, RTSMT_RTIOC_READ, &rightReadBuf);
+ioctl(rightbusfd, RTSMT_RTIOC_READ, &rightReadBuf); --- a/MC9target/plc_MC9_main_retain.c Thu Mar 22 13:48:24 2018 +0100
+++ b/MC9target/plc_MC9_main_retain.c Fri Mar 23 11:30:50 2018 +0100
@@ -60,24 +60,24 @@
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_LOCK_CS_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_LOCK_CS_SET, &uint) < 0) { printf("Failed to lock CS\n");
- status = rt_dev_write(fd_spi, rcmd, ARRAY_SIZE(rcmd));
+ status = write(fd_spi, rcmd, ARRAY_SIZE(rcmd)); fprintf(stderr, "Failed to send read command. ERR : %d\n", status);
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_LOCK_CS_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_LOCK_CS_SET, &uint) < 0) { printf("Failed to unlock CS\n");
- size = rt_dev_read(fd_spi, buf, len);
+ size = read(fd_spi, buf, len); fprintf(stderr, "Failed to read %d bytes on the SPI bus. size : %d\n",
@@ -89,7 +89,7 @@
int SPI_Write(void *buf, unsigned int len){
- status = rt_dev_write(fd_spi, buf, len);
+ status = write(fd_spi, buf, len); fprintf(stderr, "Failed to write memory. ERR : %d\n", status);
@@ -103,7 +103,7 @@
/* Open the SPI RTDM device */
- if ((fd_spi = rt_dev_open("spi_apf28_rtdm", TEST_SPI_BUS_NUMBER)) < 0) {
+ if ((fd_spi = open("/dev/rtdm/spi_apf28_rtdm", TEST_SPI_BUS_NUMBER)) < 0) { printf("rt_spi_open error\n");
@@ -112,66 +112,66 @@
uint = TEST_SPI_CLK_PHASE;
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CLKPHASE_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CLKPHASE_SET, &uint) < 0) { printf("Failed to configure the clock phase\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CLKPHASE_GET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CLKPHASE_GET, &uint) < 0) { printf("Failed to get the clock phase\n");
uint = TEST_SPI_CLK_POLARITY;
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CLKPOLARITY_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CLKPOLARITY_SET, &uint) < 0) { printf("Failed to configure the clock polarity\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CLKPOLARITY_GET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CLKPOLARITY_GET, &uint) < 0) { printf("Failed to get the clock polarity\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_FREQ_SET, &ulong) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_FREQ_SET, &ulong) < 0) { printf("Failed to configure the frequency\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_FREQ_GET, &ulong) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_FREQ_GET, &ulong) < 0) { printf("Failed to get the frequency\n");
uint = TEST_SPI_BITS_PER_WORD;
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_BITSPERWORD_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_BITSPERWORD_SET, &uint) < 0) { printf("Failed to configure the BPW\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_BITSPERWORD_GET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_BITSPERWORD_GET, &uint) < 0) { printf("Failed to get the BPW\n");
uint = TEST_SPI_CHIPSELECT1;
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CHIPSELECT_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CHIPSELECT_SET, &uint) < 0) { printf("Failed to configure the chip select\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_CHIPSELECT_GET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_CHIPSELECT_GET, &uint) < 0) { printf("Failed to get the chip select\n");
/* DMA usage definition */
uint = TEST_SPI_DMA_BYTES_MIN;
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_DMA_SET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_DMA_SET, &uint) < 0) { printf("Failed to configure the DMA threshold\n");
- if (rt_dev_ioctl(fd_spi, RTDM_SPI_DMA_GET, &uint) < 0) {
+ if (ioctl(fd_spi, RTDM_SPI_DMA_GET, &uint) < 0) { printf("Failed to get the DMA threshold\n");
@@ -194,7 +194,7 @@
- status = rt_dev_write(fd_spi, mbuf, ARRAY_SIZE(mbuf));
+ status = write(fd_spi, mbuf, ARRAY_SIZE(mbuf)); printf("Failed to change mode. ERR : %d\n", status);