diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-07-11 19:34:19 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-07-11 19:40:21 -0400 |
commit | d9f960fb0c242462e9e894104217d58439b515e2 (patch) | |
tree | dc89dbb0a439160c07a341dd6904bfc7cc6e22e0 | |
parent | f60b0093b7a225f9f93323098f5a9e2120b55b41 (diff) | |
download | kutter-d9f960fb0c242462e9e894104217d58439b515e2.tar.gz kutter-d9f960fb0c242462e9e894104217d58439b515e2.tar.xz kutter-d9f960fb0c242462e9e894104217d58439b515e2.zip |
avr: Configure spi transfer in spi_prepare()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/avr/gpio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/avr/gpio.c b/src/avr/gpio.c index fdb18562..15aaeae6 100644 --- a/src/avr/gpio.c +++ b/src/avr/gpio.c @@ -438,17 +438,17 @@ spi_setup(uint32_t bus, uint8_t mode, uint32_t rate) return config; } -void spi_prepare(struct spi_config config) +void +spi_prepare(struct spi_config config) { + SPCR = config.spcr; + SPSR = config.spsr; } void spi_transfer(struct spi_config config, uint8_t receive_data , uint8_t len, uint8_t *data) { - SPCR = config.spcr; - SPSR = config.spsr; - if (receive_data) { while (len--) { SPDR = *data; |