diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-07-30 17:43:12 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-07-31 23:18:46 -0400 |
commit | 0f3b1bce6635cff5b7bcaf21e3ec92a6a6fdf2f3 (patch) | |
tree | 29107d7ac9ee22fba11ac3dcea950615621ee849 | |
parent | 1f7c3fc8ec37319cb3b9309343d301a9d30afdfd (diff) | |
download | kutter-0f3b1bce6635cff5b7bcaf21e3ec92a6a6fdf2f3.tar.gz kutter-0f3b1bce6635cff5b7bcaf21e3ec92a6a6fdf2f3.tar.xz kutter-0f3b1bce6635cff5b7bcaf21e3ec92a6a6fdf2f3.zip |
linux: Set the SPI mode in spidev.c
Fix omission causing the SPI mode to not be set on the linux mcu.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/linux/spidev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linux/spidev.c b/src/linux/spidev.c index 166db395..a7733704 100644 --- a/src/linux/spidev.c +++ b/src/linux/spidev.c @@ -70,6 +70,11 @@ spi_setup(uint32_t bus, uint8_t mode, uint32_t rate) report_errno("ioctl set max spi speed", ret); shutdown("Unable to set SPI speed"); } + ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); + if (ret < 0) { + report_errno("ioctl set spi mode", ret); + shutdown("Unable to set SPI mode"); + } return (struct spi_config) { fd , rate}; } |