{
int otherchan = (dmachan == 1) ? 2 : 1;
bool ret;
- portENTER_CRITICAL(&dmaworkaround_mux);
+ portENTER_CRITICAL_ISR(&dmaworkaround_mux);
if (dmaworkaround_channels_busy[otherchan-1]) {
//Other channel is busy. Call back when it's done.
dmaworkaround_cb = cb;
periph_module_reset( PERIPH_SPI_DMA_MODULE );
ret = true;
}
- portEXIT_CRITICAL(&dmaworkaround_mux);
+ portEXIT_CRITICAL_ISR(&dmaworkaround_mux);
return ret;
}
void IRAM_ATTR spicommon_dmaworkaround_idle(int dmachan)
{
- portENTER_CRITICAL(&dmaworkaround_mux);
+ portENTER_CRITICAL_ISR(&dmaworkaround_mux);
dmaworkaround_channels_busy[dmachan-1] = 0;
if (dmaworkaround_waiting_for_chan == dmachan) {
//Reset DMA
dmaworkaround_cb(dmaworkaround_cb_arg);
}
- portEXIT_CRITICAL(&dmaworkaround_mux);
+ portEXIT_CRITICAL_ISR(&dmaworkaround_mux);
}
void IRAM_ATTR spicommon_dmaworkaround_transfer_active(int dmachan)
{
- portENTER_CRITICAL(&dmaworkaround_mux);
+ portENTER_CRITICAL_ISR(&dmaworkaround_mux);
dmaworkaround_channels_busy[dmachan-1] = 1;
- portEXIT_CRITICAL(&dmaworkaround_mux);
+ portEXIT_CRITICAL_ISR(&dmaworkaround_mux);
}