summaryrefslogtreecommitdiff
path: root/platforms/chibios/drivers
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-07-06 06:41:35 +1000
committerGitHub <noreply@github.com>2022-07-05 22:41:35 +0200
commit29a2bac4691dae81a613af31e5e99660e61edc3d (patch)
tree7274e3f5bebbb3f4900346fec11c29a6f8f3aa14 /platforms/chibios/drivers
parent0e5d67145a649480fd49a72712997feb6303a471 (diff)
Fixup SPI. (#17534)
Diffstat (limited to 'platforms/chibios/drivers')
-rw-r--r--platforms/chibios/drivers/spi_master.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/platforms/chibios/drivers/spi_master.c b/platforms/chibios/drivers/spi_master.c
index f9974d9f6b..223d8a403e 100644
--- a/platforms/chibios/drivers/spi_master.c
+++ b/platforms/chibios/drivers/spi_master.c
@@ -46,6 +46,9 @@ __attribute__((weak)) void spi_init(void) {
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST);
#endif
+ spiUnselect(&SPI_DRIVER);
+ spiStop(&SPI_DRIVER);
+ currentSlavePin = NO_PIN;
}
}