reduce amount of warnings

This commit is contained in:
ju6ge 2025-09-11 20:17:18 +02:00
parent 4fa1a05fc3
commit 4faae86a6b
Signed by: judge
GPG Key ID: 6512C30DD8E017B5
5 changed files with 9 additions and 19 deletions

View File

@ -113,7 +113,7 @@ pub trait BoardInteraction<'a> {
impl dyn BoardInteraction<'_> {
//the counter is just some arbitrary number that increases whenever some progress was made, try to keep the updates < 10 per second for ux reasons
fn progress(&mut self, counter: u32) {
fn _progress(&mut self, counter: u32) {
let even = counter % 2 == 0;
let current = counter / (PLANT_COUNT as u32);
for led in 0..PLANT_COUNT {

View File

@ -210,7 +210,7 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
&self.config
}
fn get_battery_monitor(&mut self) -> &mut Box<(dyn BatteryInteraction + Send + 'static)> {
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction + Send + 'static> {
&mut self.battery_monitor
}

View File

@ -13,7 +13,7 @@ use anyhow::bail;
use embedded_hal::digital::OutputPin;
use embedded_hal_bus::i2c::MutexDevice;
use esp_idf_hal::gpio::{AnyInputPin, IOPin, InputOutput, Output, PinDriver, Pull};
use esp_idf_hal::i2c::{I2cDriver, I2cError};
use esp_idf_hal::i2c::I2cDriver;
use esp_idf_hal::pcnt::{
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
};
@ -23,12 +23,10 @@ use ina219::calibration::UnCalibrated;
use ina219::configuration::{Configuration, OperatingMode};
use ina219::SyncIna219;
use measurements::{Current, Resistance, Voltage};
use pca9535::{ExpanderError, GPIOBank, Pca9535Immediate, StandardExpanderInterface};
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
use std::result::Result::Ok as OkStd;
use embedded_can::nb::Can;
use embedded_can::Frame;
use embedded_can::StandardId;
use esp_idf_hal::prelude::*;
use esp_idf_hal::can;
pub enum Charger<'a> {
@ -205,7 +203,7 @@ pub(crate) fn create_v4(
println!("Can bus mode ");
let timing = can::config::Timing::B25K;
let config = can::config::Config::new().timing(timing);
let mut can = can::CanDriver::new(peripherals.can, peripherals.gpio0, peripherals.gpio2, &config).unwrap();
let can = can::CanDriver::new(peripherals.can, peripherals.gpio0, peripherals.gpio2, &config).unwrap();
let frame = StandardId::new(0x042).unwrap();

View File

@ -93,14 +93,6 @@ pub struct PumpResult {
pump_time_s: u16,
}
#[derive(Serialize, Deserialize, Debug, PartialEq)]
/// humidity sensor error
enum SensorError {
Unknown,
ShortCircuit { hz: f32, max: f32 },
OpenCircuit { hz: f32, min: f32 },
}
#[derive(Serialize, Debug, PartialEq)]
enum SntpMode {
OFFLINE,
@ -867,7 +859,7 @@ fn pump_info(
median_current_ma: u16,
max_current_ma: u16,
min_current_ma: u16,
error: bool,
_error: bool,
) {
let pump_info = PumpInfo {
enabled: pump_active,

View File

@ -238,7 +238,7 @@ impl PlantState {
}
PlantWateringMode::MinMoisture => {
let (moisture_percent, _) = self.plant_moisture();
if let Some(moisture_percent) = moisture_percent {
if let Some(_moisture_percent) = moisture_percent {
if self.pump_in_timeout(plant_conf, current_time) {
false
} else if !in_time_range(
@ -247,10 +247,10 @@ impl PlantState {
plant_conf.pump_hour_end,
) {
false
} else if (true) {
} else if true {
//if not cooldown min and below max
true
} else if (true) {
} else if true {
//if below min disable cooldown min
true
} else {