Fix rp uart example
This commit is contained in:
parent
d52c7ded49
commit
0f74f870b0
2 changed files with 4 additions and 4 deletions
|
@ -151,7 +151,7 @@ impl<'d, T: Instance> UartRx<'d, T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'d, T: Instance> Uart<'d, T> {
|
impl<'d, T: Instance> Uart<'d, T> {
|
||||||
/// Create a new UARTE without hardware flow control
|
/// Create a new UART without hardware flow control
|
||||||
pub fn new(
|
pub fn new(
|
||||||
uart: impl Peripheral<P = T> + 'd,
|
uart: impl Peripheral<P = T> + 'd,
|
||||||
tx: impl Peripheral<P = impl TxPin<T>> + 'd,
|
tx: impl Peripheral<P = impl TxPin<T>> + 'd,
|
||||||
|
|
|
@ -9,11 +9,11 @@ use {defmt_rtt as _, panic_probe as _};
|
||||||
#[embassy_executor::main]
|
#[embassy_executor::main]
|
||||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||||
let config = uart::Config::default();
|
let config = uart::Config::default();
|
||||||
let mut uart = uart::Uart::new(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config);
|
let mut uart = uart::Uart::new_with_rtscts(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config);
|
||||||
uart.send("Hello World!\r\n".as_bytes());
|
uart.blocking_write("Hello World!\r\n".as_bytes()).unwrap();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
uart.send("hello there!\r\n".as_bytes());
|
uart.blocking_write("hello there!\r\n".as_bytes()).unwrap();
|
||||||
cortex_m::asm::delay(1_000_000);
|
cortex_m::asm::delay(1_000_000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue