spi: wrap continue in atomic block
@@ -537,7 +537,7 @@ static bool spi_txn_should_use_dma(spi_txn_t *txn) {
}
void spi_txn_continue_ex(spi_bus_device_t *bus, bool force_sync) {
- // ensures this function can only run once the dma transaction is done
+ ATOMIC_BLOCK_ALL {
if (!spi_dma_is_ready(bus->port)) {
return;
}
@@ -553,7 +553,6 @@ void spi_txn_continue_ex(spi_bus_device_t *bus, bool force_sync) {
return;
}
- ATOMIC_BLOCK_ALL {
const uint32_t tail = (bus->txn_tail + 1) % SPI_TXN_MAX;
spi_txn_t *txn = bus->txns[tail];
