using correct pipes now
This commit is contained in:
@@ -4,17 +4,9 @@ use embassy_futures::select::{select, Either};
|
||||
use embassy_stm32::usart::BufferedUart;
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::pipe::Pipe;
|
||||
use embassy_time::Duration;
|
||||
use embedded_io_async::{Read, Write};
|
||||
|
||||
use crate::hw_uart_pc::safety::{RX_PIPE_CAP, TX_PIPE_CAP};
|
||||
|
||||
pub struct UartHandle {
|
||||
pub tx: &'static Pipe<CriticalSectionRawMutex, TX_PIPE_CAP>,
|
||||
pub rx: &'static Pipe<CriticalSectionRawMutex, RX_PIPE_CAP>,
|
||||
pub yield_period: Duration,
|
||||
}
|
||||
|
||||
#[embassy_executor::task]
|
||||
pub async fn uart_task(
|
||||
mut uart: BufferedUart<'static>,
|
||||
|
||||
@@ -3,18 +3,10 @@ use defmt::info;
|
||||
use embassy_time::Duration;
|
||||
|
||||
use crate::hw_uart_pc::safety::preflight_and_suggest_yield_period;
|
||||
use crate::hw_uart_pc::driver::UartHandle;
|
||||
use crate::config::{PIPE_HW_TX, PIPE_HW_RX};
|
||||
|
||||
pub fn setup_and_spawn(baudrate: u32,) -> (UartHandle, Duration) {
|
||||
pub fn setup_and_spawn(baudrate: u32,) -> Duration {
|
||||
let yield_period: Duration = preflight_and_suggest_yield_period(baudrate);
|
||||
info!("HW USART1 safe");
|
||||
|
||||
let handle = UartHandle {
|
||||
tx: &PIPE_HW_TX,
|
||||
rx: &PIPE_HW_RX,
|
||||
yield_period,
|
||||
};
|
||||
|
||||
(handle, yield_period)
|
||||
yield_period
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user