diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-08-06 11:44:29 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-08-06 18:56:53 -0400 |
commit | c2a08962b79ccdb4b33b26becefa247506a7fd40 (patch) | |
tree | a3cb44e1d877f9af05bce7fb5dc22c7ae3221227 /src/linux/spidev.c | |
parent | 30bd7c0e47ddf495db54448d1fdf085ab480efea (diff) | |
download | kutter-c2a08962b79ccdb4b33b26becefa247506a7fd40.tar.gz kutter-c2a08962b79ccdb4b33b26becefa247506a7fd40.tar.xz kutter-c2a08962b79ccdb4b33b26becefa247506a7fd40.zip |
spicmds: Rework spi config commands
Rework the spi_config commands so that bus configuration and shutdown
message configuration is done separately from the main "config_spi"
command. This makes the spi configuration more flexible. It's now
possible to use software spi without a CS pin. It's now possible to
define multiple SPI messages to send on a shutdown event.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/linux/spidev.c')
-rw-r--r-- | src/linux/spidev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linux/spidev.c b/src/linux/spidev.c index 5c613cba..764541e3 100644 --- a/src/linux/spidev.c +++ b/src/linux/spidev.c @@ -97,13 +97,13 @@ spi_transfer(struct spi_config config, uint8_t receive_data int ret = ioctl(config.fd, SPI_IOC_MESSAGE(1), &transfer); if (ret < 0) { report_errno("spi ioctl", ret); - shutdown("Unable to issue spi ioctl"); + try_shutdown("Unable to issue spi ioctl"); } } else { int ret = write(config.fd, data, len); if (ret < 0) { report_errno("write spi", ret); - shutdown("Unable to write to spi"); + try_shutdown("Unable to write to spi"); } } } |