diff options
| author | Ghaith Oueslati <[email protected]> | 2023-05-02 12:25:43 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-02 12:25:43 +0100 |
| commit | 0107f83b53907be7c284c6a983433c9d55b593cd (patch) | |
| tree | 1e039633687e18c95cea547539764cd2423f8215 | |
| parent | bab30a7e876e0c7f98e1c1f39a7d2494de5daece (diff) | |
| parent | 5f99ccf54c1e2eebcd121a4281084fa54ee03fad (diff) | |
Merge branch 'embassy-rs:master' into tl_mbox
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 8 | ||||
| -rw-r--r-- | tests/rp/src/bin/uart_dma.rs | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index ebe32cc66..4084c158a 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -874,7 +874,6 @@ mod sealed { | |||
| 874 | pub trait Instance { | 874 | pub trait Instance { |
| 875 | const TX_DREQ: u8; | 875 | const TX_DREQ: u8; |
| 876 | const RX_DREQ: u8; | 876 | const RX_DREQ: u8; |
| 877 | const ID: usize; | ||
| 878 | 877 | ||
| 879 | type Interrupt: crate::interrupt::Interrupt; | 878 | type Interrupt: crate::interrupt::Interrupt; |
| 880 | 879 | ||
| @@ -909,11 +908,10 @@ impl_mode!(Async); | |||
| 909 | pub trait Instance: sealed::Instance {} | 908 | pub trait Instance: sealed::Instance {} |
| 910 | 909 | ||
| 911 | macro_rules! impl_instance { | 910 | macro_rules! impl_instance { |
| 912 | ($inst:ident, $irq:ident, $id:expr, $tx_dreq:expr, $rx_dreq:expr) => { | 911 | ($inst:ident, $irq:ident, $tx_dreq:expr, $rx_dreq:expr) => { |
| 913 | impl sealed::Instance for peripherals::$inst { | 912 | impl sealed::Instance for peripherals::$inst { |
| 914 | const TX_DREQ: u8 = $tx_dreq; | 913 | const TX_DREQ: u8 = $tx_dreq; |
| 915 | const RX_DREQ: u8 = $rx_dreq; | 914 | const RX_DREQ: u8 = $rx_dreq; |
| 916 | const ID: usize = $id; | ||
| 917 | 915 | ||
| 918 | type Interrupt = crate::interrupt::$irq; | 916 | type Interrupt = crate::interrupt::$irq; |
| 919 | 917 | ||
| @@ -939,8 +937,8 @@ macro_rules! impl_instance { | |||
| 939 | }; | 937 | }; |
| 940 | } | 938 | } |
| 941 | 939 | ||
| 942 | impl_instance!(UART0, UART0_IRQ, 0, 20, 21); | 940 | impl_instance!(UART0, UART0_IRQ, 20, 21); |
| 943 | impl_instance!(UART1, UART1_IRQ, 1, 22, 23); | 941 | impl_instance!(UART1, UART1_IRQ, 22, 23); |
| 944 | 942 | ||
| 945 | pub trait TxPin<T: Instance>: sealed::TxPin<T> + crate::gpio::Pin {} | 943 | pub trait TxPin<T: Instance>: sealed::TxPin<T> + crate::gpio::Pin {} |
| 946 | pub trait RxPin<T: Instance>: sealed::RxPin<T> + crate::gpio::Pin {} | 944 | pub trait RxPin<T: Instance>: sealed::RxPin<T> + crate::gpio::Pin {} |
diff --git a/tests/rp/src/bin/uart_dma.rs b/tests/rp/src/bin/uart_dma.rs index 92aa205c9..52f42e582 100644 --- a/tests/rp/src/bin/uart_dma.rs +++ b/tests/rp/src/bin/uart_dma.rs | |||
| @@ -53,10 +53,6 @@ async fn main(_spawner: Spawner) { | |||
| 53 | let (mut tx, mut rx, mut uart) = (p.PIN_0, p.PIN_1, p.UART0); | 53 | let (mut tx, mut rx, mut uart) = (p.PIN_0, p.PIN_1, p.UART0); |
| 54 | let mut irq = interrupt::take!(UART0_IRQ); | 54 | let mut irq = interrupt::take!(UART0_IRQ); |
| 55 | 55 | ||
| 56 | // TODO | ||
| 57 | // nuclear error reporting. just abort the entire transfer and invalidate the | ||
| 58 | // dma buffer, buffered buffer, fifo etc. | ||
| 59 | |||
| 60 | // We can't send too many bytes, they have to fit in the FIFO. | 56 | // We can't send too many bytes, they have to fit in the FIFO. |
| 61 | // This is because we aren't sending+receiving at the same time. | 57 | // This is because we aren't sending+receiving at the same time. |
| 62 | { | 58 | { |
