aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol')
-rw-r--r--tmk_core/protocol/lufa/adafruit_ble.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tmk_core/protocol/lufa/adafruit_ble.cpp b/tmk_core/protocol/lufa/adafruit_ble.cpp
index 1d8ae1038..505794a80 100644
--- a/tmk_core/protocol/lufa/adafruit_ble.cpp
+++ b/tmk_core/protocol/lufa/adafruit_ble.cpp
@@ -151,9 +151,10 @@ static struct SPI_Settings spi;
151// Initialize 4Mhz MSBFIRST MODE0 151// Initialize 4Mhz MSBFIRST MODE0
152void SPI_init(struct SPI_Settings *spi) { 152void SPI_init(struct SPI_Settings *spi) {
153 spi->spcr = _BV(SPE) | _BV(MSTR); 153 spi->spcr = _BV(SPE) | _BV(MSTR);
154#if F_CPU == 8000000
155 // For MCUs running at 8MHz (such as Feather 32U4, or 3.3V Pro Micros) we set the SPI doublespeed bit
154 spi->spsr = _BV(SPI2X); 156 spi->spsr = _BV(SPI2X);
155 157#endif
156 static_assert(SpiBusSpeed == F_CPU / 2, "hard coded at 4Mhz");
157 158
158 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 159 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {
159 // Ensure that SS is OUTPUT High 160 // Ensure that SS is OUTPUT High