Skip to content

Commit 1429b5c

Browse files
committed
samd 21 and 51 can only work reliably with SPI at 12Mhz
1 parent edd9c84 commit 1429b5c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/arduino/Adafruit_USBH_Host.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ bool tuh_max3421_spi_xfer_api(uint8_t rhport, uint8_t const *tx_buf,
142142

143143
// MAX3421e max clock is 26MHz
144144
// Depending on mcu ports, it may need to be clipped down
145-
// uint32_t max_clock = 26000000ul;
146-
uint32_t max_clock = 4000000ul;
145+
#ifdef ARDUINO_ARCH_SAMD
146+
// SAMD 21/51 can only work reliably at 12MHz
147+
uint32_t const max_clock = 12000000ul;
148+
#else
149+
uint32_t const max_clock = 26000000ul;
150+
#endif
147151

148152
SPISettings config(max_clock, MSBFIRST, SPI_MODE0);
149153
host->_spi->beginTransaction(config);

0 commit comments

Comments
 (0)