Skip to content

Commit 1cb3111

Browse files
committed
- fix: SPCR2.SCKASE needs to be set to protect the SPI from delays in the communication by interrupts from other units, thanks for finding the issue to @greiman !
1 parent 0d5733f commit 1cb3111

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SPI/SPI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ void ArduinoSPI::configSpi(arduino::SPISettings const & settings)
459459

460460
_spi_ctrl.p_regs->SPND = 0;
461461

462-
_spi_ctrl.p_regs->SPCR2 = 0;
462+
_spi_ctrl.p_regs->SPCR2 = R_SPI0_SPCR2_SCKASE_Msk;
463463

464464
/* SPMS = 0 -> SPI operation, TXMD = 0 -> full-duplex, SPxIE = 0 -> no interrupts */
465465
if (SPI_MODE_MASTER == _spi_cfg.operating_mode) {

0 commit comments

Comments
 (0)