diff --git a/app/src/main/cpp/NrsecPort.cpp b/app/src/main/cpp/NrsecPort.cpp index 4187768..a290915 100644 --- a/app/src/main/cpp/NrsecPort.cpp +++ b/app/src/main/cpp/NrsecPort.cpp @@ -154,7 +154,7 @@ void NrsecPort::RcvData(uint8_t*txbuf, uint8_t*buf, int len) for (i = 0; i < len; i++) { retval = spi_transfer(txbuf, buf + i, 1); - __android_log_print(ANDROID_LOG_INFO, TAG_SPI, "RcvData data[%d]=%x", i, *(buf + i)); + // __android_log_print(ANDROID_LOG_INFO, TAG_SPI, "RcvData data[%d]=%x", i, *(buf + i)); } } diff --git a/app/src/main/cpp/SpiPort.cpp b/app/src/main/cpp/SpiPort.cpp index 00593d6..fdb2293 100644 --- a/app/src/main/cpp/SpiPort.cpp +++ b/app/src/main/cpp/SpiPort.cpp @@ -40,18 +40,27 @@ void SpiPort::Close() int SpiPort::spi_transfer(unsigned char *txbuf, unsigned char *rxbuf, int bytes) { - struct spi_ioc_transfer xfer[2]; - int status; +#if 0 + struct spi_ioc_transfer xfer[2]; memset(xfer, 0, sizeof(xfer)); - xfer[0].tx_buf = (__u64)txbuf; xfer[0].rx_buf = (__u64)rxbuf; xfer[0].len = bytes; xfer[0].delay_usecs = 2; status = ioctl(m_fd, SPI_IOC_MESSAGE(1), xfer); +#else + struct spi_ioc_transfer xfer; + memset(&xfer, 0, sizeof(xfer)); + xfer.tx_buf = (__u64)txbuf; + xfer.rx_buf = (__u64)rxbuf; + xfer.len = bytes; + xfer.delay_usecs = 2; + + status = ioctl(m_fd, SPI_IOC_MESSAGE(1), &xfer); +#endif if (status < 0) { perror("SPI_IOC_MESSAGE");