mirror of https://github.com/Desuuuu/klipper.git
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>
This commit is contained in:
parent
1f7c3fc8ec
commit
0f3b1bce66
|
@ -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};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue