Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions cores/arduino/SERCOM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,27 @@ void SERCOM::initSPIClock(SercomSpiClockMode clockMode, uint32_t baudrate)

void SERCOM::resetSPI()
{
const uint32_t primask = __get_PRIMASK();
__disable_irq();
#ifdef USE_ZERODMA
dmaAbortTx();
dmaAbortRx();
#endif // USE_ZERODMA

_txnQueue.clear();
_spi.currentTxn = nullptr;
_spi.index = 0;
_spi.length = 0;
_spi.active = false;
_spi.useDma = false;
_spi.dmaNeedTx = false;
_spi.dmaNeedRx = false;
_spi.dmaTxDone = false;
_spi.dmaRxDone = false;
_spi.returnValue = SercomSpiError::SUCCESS;

resetSERCOM();
__set_PRIMASK(primask);
}

void SERCOM::setDataOrderSPI(SercomDataOrder dataOrder)
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.