Skip to content

Commit 73b8345

Browse files
committed
Fix example.
1 parent 48d4f93 commit 73b8345

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/serial_echo_rtic.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ use heapless::{consts::U8, spsc};
77
use nb::block;
88
use rtt_target::{rprint, rprintln};
99
use stm32l4xx_hal::{
10+
gpio::{self, Alternate, PushPull},
1011
pac::{self, USART2},
1112
prelude::*,
1213
serial::{self, Config, Serial},
1314
};
1415

16+
type TxPin = gpio::PA2<Alternate<PushPull, 7>>;
17+
type RxPin = gpio::PA3<Alternate<PushPull, 7>>;
18+
1519
#[rtic::app(device = stm32l4xx_hal::pac)]
1620
const APP: () = {
1721
struct Resources {
18-
rx: serial::Rx<USART2>,
19-
tx: serial::Tx<USART2>,
22+
rx: serial::Rx<USART2, (TxPin, RxPin)>,
23+
tx: serial::Tx<USART2, (TxPin, RxPin)>,
2024

2125
rx_prod: spsc::Producer<'static, u8, U8>,
2226
rx_cons: spsc::Consumer<'static, u8, U8>,

0 commit comments

Comments
 (0)