mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-18 12:17:56 -06:00
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>
This commit is contained in:
parent
30bd7c0e47
commit
c2a08962b7
9 changed files with 115 additions and 116 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue