small naming conventions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// src/uart/driver.rs
|
||||
// src/hw_uart_pc/driver.rs
|
||||
use defmt::unwrap;
|
||||
use embassy_futures::select::{select, Either};
|
||||
use embassy_stm32::usart::BufferedUart;
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
// src/uart/usart1.rs
|
||||
use defmt::info;
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::pipe::Pipe;
|
||||
use embassy_time::Duration;
|
||||
|
||||
use crate::hw_uart_pc::safety::{preflight_and_suggest_yield_period, RX_PIPE_CAP, TX_PIPE_CAP};
|
||||
use crate::hw_uart_pc::safety::preflight_and_suggest_yield_period;
|
||||
use crate::hw_uart_pc::driver::UartHandle;
|
||||
|
||||
// Static pipes and buffers
|
||||
static UART1_TX_PIPE: Pipe<CriticalSectionRawMutex, TX_PIPE_CAP> = Pipe::new();
|
||||
static UART1_RX_PIPE: Pipe<CriticalSectionRawMutex, RX_PIPE_CAP> = Pipe::new();
|
||||
use crate::config::{PIPE_HW_TX, PIPE_HW_RX};
|
||||
|
||||
pub fn setup_and_spawn(baudrate: u32,) -> (UartHandle, Duration) {
|
||||
let yield_period: Duration = preflight_and_suggest_yield_period(baudrate);
|
||||
info!("HW USART1 safe");
|
||||
|
||||
let handle = UartHandle {
|
||||
tx: &UART1_TX_PIPE,
|
||||
rx: &UART1_RX_PIPE,
|
||||
tx: &PIPE_HW_TX,
|
||||
rx: &PIPE_HW_RX,
|
||||
yield_period,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user