Skip to content

Commit 1a7d8d0

Browse files
authored
Merge pull request #622 from facchinm/spi_divider
SPI: restore 12MHz as maximum frequency
2 parents 5c3f7f3 + aa21f4f commit 1a7d8d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/SPI/SPI.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ void SPIClass::config(SPISettings settings)
9494
_p_sercom->disableSPI();
9595

9696
uint32_t clock_freq = settings.getClockFreq();
97-
if (clock_freq > F_CPU/2) {
98-
clock_freq = F_CPU/2;
97+
if (clock_freq > SERCOM_FREQ_REF/SPI_MIN_CLOCK_DIVIDER) {
98+
clock_freq = SERCOM_FREQ_REF/SPI_MIN_CLOCK_DIVIDER;
9999
}
100100

101101
_p_sercom->initSPI(_padTx, _padRx, SPI_CHAR_SIZE_8_BITS, getBitOrder(settings));

0 commit comments

Comments
 (0)