reduce amount of warnings
This commit is contained in:
parent
4fa1a05fc3
commit
4faae86a6b
@ -113,7 +113,7 @@ pub trait BoardInteraction<'a> {
|
|||||||
|
|
||||||
impl dyn BoardInteraction<'_> {
|
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
|
//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 even = counter % 2 == 0;
|
||||||
let current = counter / (PLANT_COUNT as u32);
|
let current = counter / (PLANT_COUNT as u32);
|
||||||
for led in 0..PLANT_COUNT {
|
for led in 0..PLANT_COUNT {
|
||||||
|
@ -210,7 +210,7 @@ impl<'a> BoardInteraction<'a> for V3<'a> {
|
|||||||
&self.config
|
&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
|
&mut self.battery_monitor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use anyhow::bail;
|
|||||||
use embedded_hal::digital::OutputPin;
|
use embedded_hal::digital::OutputPin;
|
||||||
use embedded_hal_bus::i2c::MutexDevice;
|
use embedded_hal_bus::i2c::MutexDevice;
|
||||||
use esp_idf_hal::gpio::{AnyInputPin, IOPin, InputOutput, Output, PinDriver, Pull};
|
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::{
|
use esp_idf_hal::pcnt::{
|
||||||
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
|
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
|
||||||
};
|
};
|
||||||
@ -23,12 +23,10 @@ use ina219::calibration::UnCalibrated;
|
|||||||
use ina219::configuration::{Configuration, OperatingMode};
|
use ina219::configuration::{Configuration, OperatingMode};
|
||||||
use ina219::SyncIna219;
|
use ina219::SyncIna219;
|
||||||
use measurements::{Current, Resistance, Voltage};
|
use measurements::{Current, Resistance, Voltage};
|
||||||
use pca9535::{ExpanderError, GPIOBank, Pca9535Immediate, StandardExpanderInterface};
|
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
|
||||||
use std::result::Result::Ok as OkStd;
|
use std::result::Result::Ok as OkStd;
|
||||||
use embedded_can::nb::Can;
|
|
||||||
use embedded_can::Frame;
|
use embedded_can::Frame;
|
||||||
use embedded_can::StandardId;
|
use embedded_can::StandardId;
|
||||||
use esp_idf_hal::prelude::*;
|
|
||||||
use esp_idf_hal::can;
|
use esp_idf_hal::can;
|
||||||
|
|
||||||
pub enum Charger<'a> {
|
pub enum Charger<'a> {
|
||||||
@ -205,7 +203,7 @@ pub(crate) fn create_v4(
|
|||||||
println!("Can bus mode ");
|
println!("Can bus mode ");
|
||||||
let timing = can::config::Timing::B25K;
|
let timing = can::config::Timing::B25K;
|
||||||
let config = can::config::Config::new().timing(timing);
|
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();
|
let frame = StandardId::new(0x042).unwrap();
|
||||||
|
@ -93,14 +93,6 @@ pub struct PumpResult {
|
|||||||
pump_time_s: u16,
|
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)]
|
#[derive(Serialize, Debug, PartialEq)]
|
||||||
enum SntpMode {
|
enum SntpMode {
|
||||||
OFFLINE,
|
OFFLINE,
|
||||||
@ -867,7 +859,7 @@ fn pump_info(
|
|||||||
median_current_ma: u16,
|
median_current_ma: u16,
|
||||||
max_current_ma: u16,
|
max_current_ma: u16,
|
||||||
min_current_ma: u16,
|
min_current_ma: u16,
|
||||||
error: bool,
|
_error: bool,
|
||||||
) {
|
) {
|
||||||
let pump_info = PumpInfo {
|
let pump_info = PumpInfo {
|
||||||
enabled: pump_active,
|
enabled: pump_active,
|
||||||
|
@ -238,7 +238,7 @@ impl PlantState {
|
|||||||
}
|
}
|
||||||
PlantWateringMode::MinMoisture => {
|
PlantWateringMode::MinMoisture => {
|
||||||
let (moisture_percent, _) = self.plant_moisture();
|
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) {
|
if self.pump_in_timeout(plant_conf, current_time) {
|
||||||
false
|
false
|
||||||
} else if !in_time_range(
|
} else if !in_time_range(
|
||||||
@ -247,10 +247,10 @@ impl PlantState {
|
|||||||
plant_conf.pump_hour_end,
|
plant_conf.pump_hour_end,
|
||||||
) {
|
) {
|
||||||
false
|
false
|
||||||
} else if (true) {
|
} else if true {
|
||||||
//if not cooldown min and below max
|
//if not cooldown min and below max
|
||||||
true
|
true
|
||||||
} else if (true) {
|
} else if true {
|
||||||
//if below min disable cooldown min
|
//if below min disable cooldown min
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user