diff options
author | Ryan <fauxpark@gmail.com> | 2021-01-03 14:53:53 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 14:53:53 +1100 |
commit | f3ac792c096c10c9dd5004e6e06aad60710ef599 (patch) | |
tree | efe140992dd6c3d0aba6534e06efbade4a608fb0 /drivers | |
parent | b3de903a3dfe5f75312b6b8a7555ccabe01a5e6e (diff) | |
download | qmk_firmware-f3ac792c096c10c9dd5004e6e06aad60710ef599.tar.gz qmk_firmware-f3ac792c096c10c9dd5004e6e06aad60710ef599.zip |
Align ChibiOS spi_master behaviour with AVR (#11404)
* Align ChibiOS spi_master behaviour with AVR
* Rollback `spi_transmit()` and `spi_receive()` to preserve DMA
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/chibios/spi_master.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/chibios/spi_master.c b/drivers/chibios/spi_master.c index 5aa60742e..8341b59a5 100644 --- a/drivers/chibios/spi_master.c +++ b/drivers/chibios/spi_master.c | |||
@@ -115,11 +115,17 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { | |||
115 | return true; | 115 | return true; |
116 | } | 116 | } |
117 | 117 | ||
118 | spi_status_t spi_write(uint8_t data) { return spi_transmit(&data, 1); } | 118 | spi_status_t spi_write(uint8_t data) { |
119 | uint8_t rxData; | ||
120 | spiExchange(&SPI_DRIVER, 1, &data, &rxData); | ||
121 | |||
122 | return rxData; | ||
123 | } | ||
119 | 124 | ||
120 | spi_status_t spi_read(void) { | 125 | spi_status_t spi_read(void) { |
121 | uint8_t data = 0; | 126 | uint8_t data = 0; |
122 | spi_receive(&data, 1); | 127 | spiReceive(&SPI_DRIVER, 1, &data); |
128 | |||
123 | return data; | 129 | return data; |
124 | } | 130 | } |
125 | 131 | ||