diff options
| author | Timo Kröger <[email protected]> | 2024-03-07 19:47:13 +0100 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2024-03-12 08:14:42 +0100 |
| commit | 5e271ff31b55b339d4321af4b2c8a096bf153d4b (patch) | |
| tree | 1319404e86b0af66eef9810bd3d0b4b752f40799 /examples/stm32g4/src/bin/usb_c_pd.rs | |
| parent | 36a99189210bf15c93198a4bf9a0d2ab732c8bf8 (diff) | |
[UCPD] Combine RX and TX
`select(rx.receive(), tx.transmit()` had subtle interrupt enable race conditions.
Combine receiver and transmitter into one new `PdPhy` struct to disallow the
problematic pattern.
Scanning through the USB PD 2.0 specification there is no need to have RX and TX
running concurrently (after all the USB PD communication is half-duplex).
Diffstat (limited to 'examples/stm32g4/src/bin/usb_c_pd.rs')
| -rw-r--r-- | examples/stm32g4/src/bin/usb_c_pd.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/stm32g4/src/bin/usb_c_pd.rs b/examples/stm32g4/src/bin/usb_c_pd.rs index 1443cb773..fd2400bd5 100644 --- a/examples/stm32g4/src/bin/usb_c_pd.rs +++ b/examples/stm32g4/src/bin/usb_c_pd.rs | |||
| @@ -67,7 +67,7 @@ async fn main(_spawner: Spawner) { | |||
| 67 | } | 67 | } |
| 68 | CableOrientation::DebugAccessoryMode => panic!("No PD communication in DAM"), | 68 | CableOrientation::DebugAccessoryMode => panic!("No PD communication in DAM"), |
| 69 | }; | 69 | }; |
| 70 | let (mut _rx, mut _tx) = ucpd.pd(p.DMA1_CH1, p.DMA1_CH2, cc_sel); | 70 | let mut pd_phy = ucpd.pd_phy(p.DMA1_CH1, p.DMA1_CH2, cc_sel); |
| 71 | 71 | ||
| 72 | loop {} | 72 | loop {} |
| 73 | } | 73 | } |
