cleanup
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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<CriticalSectionRawMutex, 1024>,
|
||||
tx_pin_bit: u8,
|
||||
uart_cfg: &'static UartConfig,
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user