mirror of https://github.com/ARMmbed/mbed-os.git
CircularBuffer::push() is critical section
parent
c5422eed25
commit
50e79a45f8
|
@ -124,10 +124,12 @@ int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, i
|
||||||
if (_transaction_buffer.full()) {
|
if (_transaction_buffer.full()) {
|
||||||
return -1; // the buffer is full
|
return -1; // the buffer is full
|
||||||
} else {
|
} else {
|
||||||
|
__disable_irq();
|
||||||
_transaction_buffer.push(transaction);
|
_transaction_buffer.push(transaction);
|
||||||
if (!spi_active(&_spi)) {
|
if (!spi_active(&_spi)) {
|
||||||
dequeue_transaction();
|
dequeue_transaction();
|
||||||
}
|
}
|
||||||
|
__enable_irq();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue