driver/spi: add _ISR counterparts if invoked from interrupt for critical section
@@ -438,7 +438,7 @@ bool IRAM_ATTR spicommon_dmaworkaround_req_reset(int dmachan, dmaworkaround_cb_t
{
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;
@@ -450,7 +450,7 @@ bool IRAM_ATTR spicommon_dmaworkaround_req_reset(int dmachan, dmaworkaround_cb_t
periph_module_reset( PERIPH_SPI_DMA_MODULE );
ret = true;
}
- portEXIT_CRITICAL(&dmaworkaround_mux);
+ portEXIT_CRITICAL_ISR(&dmaworkaround_mux);
return ret;
}
@@ -461,7 +461,7 @@ bool IRAM_ATTR spicommon_dmaworkaround_reset_in_progress()
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
@@ -471,14 +471,14 @@ void IRAM_ATTR spicommon_dmaworkaround_idle(int dmachan)
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);
}
