diff --git a/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_rx.rs b/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_rx.rs index 326a0d3..d3530be 100644 --- a/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_rx.rs +++ b/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_rx.rs @@ -78,9 +78,7 @@ pub async fn rx_dma_task( // } } - // Shift remaining data to front - // We processed 'consumed' samples. - // Keeping the rest of the data + // Shift remaining data to history partition let remaining = current_end - consumed; if remaining > 0 { diff --git a/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_tx.rs b/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_tx.rs index 9aa84c2..150fe75 100644 --- a/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_tx.rs +++ b/semestralka_1_final_crate/software_uart/src/gpio_dma_uart_tx.rs @@ -42,7 +42,6 @@ pub async fn encode_uart_frames<'a>( pub async fn tx_dma_task( mut ch: Peri<'static, GPDMA1_CH0>, register: *mut u32, // GPIOx_BSRR - tx_ring_mem: &'static mut [u32], pipe_rx: &'static Pipe, tx_pin_bit: u8, uart_cfg: &'static UartConfig, diff --git a/semestralka_1_final_crate/software_uart/src/uart_emulation.rs b/semestralka_1_final_crate/software_uart/src/uart_emulation.rs index 56992f0..eaf92de 100644 --- a/semestralka_1_final_crate/software_uart/src/uart_emulation.rs +++ b/semestralka_1_final_crate/software_uart/src/uart_emulation.rs @@ -148,7 +148,7 @@ pub fn decode_uart_samples( let mut error_data = false; if cfg.parity != Parity::None { - let expected_parity = calculate_parity(data, cfg.parity, cfg.data_bits); + let expected_parity = calculate_parity(data, cfg.parity); let actual_parity = get_bit(scan_idx); if expected_parity != actual_parity { // Parity error @@ -192,7 +192,7 @@ pub fn decode_uart_samples( } /// Calculate the expected parity bit (0 or 1) for the given data and parity mode -fn calculate_parity(data: u8, parity: Parity, data_bits: u8) -> u8 { +fn calculate_parity(data: u8, parity: Parity) -> u8 { match parity { Parity::None => 0, Parity::Even | Parity::Odd => { diff --git a/semestralka_1_final_lib/src/bin/main.rs b/semestralka_1_final_lib/src/bin/main.rs index 3ec7c9e..98456e2 100644 --- a/semestralka_1_final_lib/src/bin/main.rs +++ b/semestralka_1_final_lib/src/bin/main.rs @@ -141,7 +141,6 @@ async fn main(spawner: Spawner) { spawner.spawn(tx_dma_task( p.GPDMA1_CH0, bsrr_ptr, - SW_TX_RING.init([0; TX_RING_BYTES]), &PIPE_SW_TX, TX_PIN_BIT, &UART_CFG, diff --git a/semestralka_1_final_lib/src/config.rs b/semestralka_1_final_lib/src/config.rs index 8329f12..936603e 100644 --- a/semestralka_1_final_lib/src/config.rs +++ b/semestralka_1_final_lib/src/config.rs @@ -3,7 +3,7 @@ use software_uart::uart_emulation::{Parity, StopBits, UartConfig}; use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; use embassy_sync::pipe::Pipe; -pub const BAUD: u32 = 9_600; +pub const BAUD: u32 = 57_600; // pub const TX_PIN_BIT: u8 = 2; // PA2 // pub const RX_PIN_BIT: u8 = 3; // PA3 pub const TX_PIN_BIT: u8 = 0; // PB2