Browse files

Issue with ioctl

 "Error – Problem transmitting spi data..ioctl: Invalid argument

Due to changes in the underlying library the spi_ioc_transfer struct now needs to be initialised to NULL
  • Loading branch information...
efargas committed Apr 30, 2016
1 parent 5c62461 commit 8d06227ea5526c4f0623f1ae48046ce74bc6179c
Showing with 1 addition and 0 deletions.
  1. +1 −0 library/bus/SPIDevice.cpp
@@ -86,6 +86,7 @@ int SPIDevice::open(){
int SPIDevice::transfer(unsigned char send[], unsigned char receive[], int length){
struct spi_ioc_transfer transfer;
+ memset(&transfer,0,sizeof(transfer));
transfer.tx_buf = (unsigned long) send;
transfer.rx_buf = (unsigned long) receive;
transfer.len = length;

0 comments on commit 8d06227

Please sign in to comment.