small naming conventions

This commit is contained in:
Priec
2025-11-11 23:30:03 +01:00
parent c1d0fa9d04
commit a35d1df67f
4 changed files with 27 additions and 21 deletions

View File

@@ -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;

View File

@@ -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,
};