-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
The uart-dma example does not show how to send data with different length using dma.
Is this not supported by this crate or is it even a hardware limitation?
example:
[...]
let data_to_send = [
&b"Hello"[..], // These are to be sent one at a time to simulate sending messages of different sizes
&b"I"[..],
&b"am Bob the Bot"[..],
];
// Setup DMA for USART2 TX with dma channel 1.
let mut transfer =
streams
.0
.into_memory_to_peripheral_transfer(tx.enable_dma(), &mut tx_buffer[..], config);
transfer.start(|_tx| {});
loop {
while !transfer.get_transfer_complete_flag() {}
delay_syst.delay(1000.millis());
led.toggle().unwrap();
transfer.restart(|_tx| {}); // <---------- Do something here to either change buffer to data_to_send[i],
// , or copy to tx_buffer (assuming it is large enough) and tell `transfer` the new data length
}
Metadata
Metadata
Assignees
Labels
No labels