stm32/serial: update to new traits.
This commit is contained in:
@ -12,10 +12,11 @@ use example_common::{panic, *};
|
||||
use cortex_m::singleton;
|
||||
use cortex_m_rt::entry;
|
||||
use embassy::executor::{task, Executor};
|
||||
use embassy::traits::uart::Uart;
|
||||
use embassy::traits::uart::{Read, Write};
|
||||
use embassy::util::Forever;
|
||||
use embassy_stm32f4::interrupt;
|
||||
use embassy_stm32f4::serial;
|
||||
use futures::pin_mut;
|
||||
use stm32f4xx_hal::dma::StreamsTuple;
|
||||
use stm32f4xx_hal::prelude::*;
|
||||
use stm32f4xx_hal::serial::config::Config;
|
||||
@ -76,10 +77,12 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
|
||||
clocks,
|
||||
)
|
||||
};
|
||||
pin_mut!(serial);
|
||||
|
||||
let buf = singleton!(: [u8; 30] = [0; 30]).unwrap();
|
||||
|
||||
buf[5] = 0x01;
|
||||
serial.send(buf).await.unwrap();
|
||||
serial.write(buf).await.unwrap();
|
||||
}
|
||||
|
||||
static EXECUTOR: Forever<Executor> = Forever::new();
|
||||
|
Reference in New Issue
Block a user