mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
Enables half transfer ir when constructing a ReadableDmaRingBuffer
The half transfer irq needs to be enabled in order for the hardware to notify the waker when the transfer is at half. This is needed to ensure no overuns occur when using `ReadableDmaRingBuffer`'s `read_exact`. Otherwise we are only notified when the DMA has completed its cycle and is on its way to start overwriting the data. The docs in the dma_bdma buf module also seem to imply that the half transfer irq must be enabled for proper operation. The only consumers of the `ReadableDmaRingBuffer` api are the sai module and the `RingBufferedUartRx`. The former enables the irq manually when constructing the transfer options while the latter does not. This may also be the cause for #1441.
This commit is contained in:
parent
cfe8561550
commit
00ff1409cd
@ -904,6 +904,7 @@ impl<'a, W: Word> WritableRingBuffer<'a, W> {
|
||||
let data_size = W::size();
|
||||
let buffer_ptr = buffer.as_mut_ptr();
|
||||
|
||||
options.half_transfer_ir = true;
|
||||
options.complete_transfer_ir = true;
|
||||
options.circular = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user