From 45c8107ecd0c735cf87283ece0403bba6128ad0f Mon Sep 17 00:00:00 2001 From: Juraj Sadel Date: Mon, 15 Jul 2024 12:49:39 +0200 Subject: [PATCH] esp-hal: remove warnings in PCNT example and HIL test (#1793) --- examples/src/bin/pcnt_encoder.rs | 6 +++--- hil-test/tests/pcnt.rs | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/src/bin/pcnt_encoder.rs b/examples/src/bin/pcnt_encoder.rs index b803e691d..4aae234b7 100644 --- a/examples/src/bin/pcnt_encoder.rs +++ b/examples/src/bin/pcnt_encoder.rs @@ -41,14 +41,14 @@ fn main() -> ! { // Set up a pulse counter: println!("setup pulse counter unit 0"); let pcnt = Pcnt::new(peripherals.PCNT, Some(interrupt_handler)); - let mut u0 = pcnt.unit1; + let u0 = pcnt.unit1; u0.set_low_limit(Some(-100)).unwrap(); u0.set_high_limit(Some(100)).unwrap(); u0.set_filter(Some(min(10u16 * 80, 1023u16))).unwrap(); u0.clear(); println!("setup channel 0"); - let mut ch0 = &u0.channel0; + let ch0 = &u0.channel0; let mut pin_a = io.pins.gpio4; let mut pin_b = io.pins.gpio5; @@ -64,7 +64,7 @@ fn main() -> ! { ch0.set_input_mode(channel::EdgeMode::Increment, channel::EdgeMode::Decrement); println!("setup channel 1"); - let mut ch1 = &u0.channel1; + let ch1 = &u0.channel1; ch1.set_ctrl_signal(PcntSource::from_pin( &mut pin_b, PcntInputConfig { pull: Pull::Up }, diff --git a/hil-test/tests/pcnt.rs b/hil-test/tests/pcnt.rs index 78723170e..16d29ab38 100644 --- a/hil-test/tests/pcnt.rs +++ b/hil-test/tests/pcnt.rs @@ -25,11 +25,7 @@ mod tests { clock::ClockControl, delay::Delay, gpio::{Io, Level, Output, Pull}, - pcnt::{ - channel, - channel::{CtrlMode, EdgeMode, PcntInputConfig, PcntSource}, - unit, - }, + pcnt::channel::{EdgeMode, PcntInputConfig, PcntSource}, peripherals::Peripherals, system::SystemControl, };