From 08db62f4f98544b627c52cc3b05f62edf3a75d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael?= <40151420+ldericher@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:36:02 +0000 Subject: [PATCH] fix lint errors --- bluepill-rs/src/dmx2.rs | 9 +++++---- bluepill-rs/src/main.rs | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bluepill-rs/src/dmx2.rs b/bluepill-rs/src/dmx2.rs index 47bbf4f..8823699 100644 --- a/bluepill-rs/src/dmx2.rs +++ b/bluepill-rs/src/dmx2.rs @@ -73,6 +73,7 @@ impl TxDMA { } } +#[allow(clippy::upper_case_acronyms)] pub struct DMX { tx_universe: DMXUniverse, sender: TxDMA, @@ -106,8 +107,8 @@ impl DMX { unsafe { pac::CorePeripherals::steal() .NVIC - .set_priority(pac::Interrupt::DMA1_CHANNEL4, 1) - }; + .set_priority(pac::Interrupt::DMA1_CHANNEL4, 1); + } // Serial config let serial = serial::Serial::new( @@ -118,7 +119,7 @@ impl DMX { ), mapr, 250_000.bps(), - &clocks, + clocks, ); Self { @@ -136,6 +137,6 @@ impl DMX { } pub fn tx_is_idle(&mut self) -> bool { - return self.sender.is_idle(); + self.sender.is_idle() } } diff --git a/bluepill-rs/src/main.rs b/bluepill-rs/src/main.rs index 0867908..1105167 100644 --- a/bluepill-rs/src/main.rs +++ b/bluepill-rs/src/main.rs @@ -40,7 +40,7 @@ mod app { int_pin: gpio::gpiob::PB10>, } - #[init(local = [buffer: [u8; DMX_LEN * 2] = [0b01010101; DMX_LEN * 2]])] + #[init(local = [buffer: [u8; DMX_LEN * 2] = [0b0101_0101; DMX_LEN * 2]])] fn init(mut cx: init::Context) -> (Shared, Local, init::Monotonics) { // Take ownership over the raw flash and rcc devices and convert them into the corresponding // HAL structs @@ -103,7 +103,7 @@ mod app { .pc13 .into_push_pull_output_with_state(&mut gpioc.crh, gpio::PinState::High), - int_pin: int_pin, + int_pin, }, init::Monotonics(mono), ) @@ -118,7 +118,7 @@ mod app { #[task(local = [led], shared = [delay_us, dmx])] fn sender(mut cx: sender::Context) { - cx.shared.dmx.lock(|dmx| dmx.start_tx()); + cx.shared.dmx.lock(DMX::start_tx); cx.local.led.toggle(); cx.shared.delay_us.lock(|d| d.delay(1.secs()));