aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-05-01 15:35:39 +0000
committerGitHub <[email protected]>2023-05-01 15:35:39 +0000
commit05c36e05f9f6b1a0a36982239b2e7c697f0d3734 (patch)
tree68852621ce845a7e5a6e15ee07bbcb54b49ef9a8 /examples
parentac0ea406f91a5b630811accd0c97a622a020c700 (diff)
parentb58b9ff390fb885f0cca2ad15fc89d537f3a9818 (diff)
Merge #1414
1414: rp: report errors from buffered and dma uart receives r=Dirbaio a=pennae neither of these reported errors so far, which is not ideal. add error reporting to both of them that matches the blocking error reporting as closely as is feasible, even allowing partial receives from buffered uarts before errors are reported where they would have been by the blocking code. dma transfers don't do this, if an errors applies to any byte in a transfer the entire transfer is nuked (though we probably could report how many bytes have been transferred). Co-authored-by: pennae <[email protected]>
Diffstat (limited to 'examples')
-rw-r--r--examples/rp/src/bin/uart_unidir.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/rp/src/bin/uart_unidir.rs b/examples/rp/src/bin/uart_unidir.rs
index f56e7009f..4119a309f 100644
--- a/examples/rp/src/bin/uart_unidir.rs
+++ b/examples/rp/src/bin/uart_unidir.rs
@@ -7,6 +7,7 @@
7 7
8use defmt::*; 8use defmt::*;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_rp::interrupt;
10use embassy_rp::peripherals::UART1; 11use embassy_rp::peripherals::UART1;
11use embassy_rp::uart::{Async, Config, UartRx, UartTx}; 12use embassy_rp::uart::{Async, Config, UartRx, UartTx};
12use embassy_time::{Duration, Timer}; 13use embassy_time::{Duration, Timer};
@@ -17,7 +18,13 @@ async fn main(spawner: Spawner) {
17 let p = embassy_rp::init(Default::default()); 18 let p = embassy_rp::init(Default::default());
18 19
19 let mut uart_tx = UartTx::new(p.UART0, p.PIN_0, p.DMA_CH0, Config::default()); 20 let mut uart_tx = UartTx::new(p.UART0, p.PIN_0, p.DMA_CH0, Config::default());
20 let uart_rx = UartRx::new(p.UART1, p.PIN_5, p.DMA_CH1, Config::default()); 21 let uart_rx = UartRx::new(
22 p.UART1,
23 p.PIN_5,
24 interrupt::take!(UART1_IRQ),
25 p.DMA_CH1,
26 Config::default(),
27 );
21 28
22 unwrap!(spawner.spawn(reader(uart_rx))); 29 unwrap!(spawner.spawn(reader(uart_rx)));
23 30