CircularBuffer::push() is critical section

pull/1626/head
mtkrtk 2016-04-25 17:36:53 +09:00
parent c5422eed25
commit 50e79a45f8
1 changed files with 2 additions and 0 deletions

View File

@ -124,10 +124,12 @@ int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, i
if (_transaction_buffer.full()) {
return -1; // the buffer is full
} else {
__disable_irq();
_transaction_buffer.push(transaction);
if (!spi_active(&_spi)) {
dequeue_transaction();
}
__enable_irq();
return 0;
}
#else