mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/spi_concurrency' into 'master'
spi: fix a possible concurrency issue (port to master) See merge request idf/esp-idf!5191
This commit is contained in:
commit
092179207e
@ -361,12 +361,14 @@ static void SPI_SLAVE_ISR_ATTR spi_intr(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
//Disable interrupt before checking to avoid concurrency issue.
|
||||
esp_intr_disable(host->intr);
|
||||
//Grab next transaction
|
||||
r = xQueueReceiveFromISR(host->trans_queue, &trans, &do_yield);
|
||||
if (!r) {
|
||||
//No packet waiting. Disable interrupt.
|
||||
esp_intr_disable(host->intr);
|
||||
} else {
|
||||
if (r) {
|
||||
//enable the interrupt again if there is packet to send
|
||||
esp_intr_enable(host->intr);
|
||||
|
||||
//We have a transaction. Send it.
|
||||
host->cur_trans = trans;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user