From 0f3b1bce6635cff5b7bcaf21e3ec92a6a6fdf2f3 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 30 Jul 2020 17:43:12 -0400 Subject: [PATCH] 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 --- src/linux/spidev.c | 5 +++++ 1 file changed, 5 insertions(+) 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}; }