fix all warnings

This commit is contained in:
2025-06-20 21:31:12 +02:00
parent d0e5627815
commit 5621f17e61
7 changed files with 16 additions and 28 deletions

View File

@@ -97,6 +97,7 @@ impl BatteryInteraction for NoBatteryMonitor {
}
//TODO implement this battery monitor kind once controller is complete
#[allow(dead_code)]
pub struct WchI2cSlave {}
pub struct BQ34Z100G1<'a> {

View File

@@ -51,11 +51,6 @@ const TANK_MULTI_SAMPLE: usize = 11;
pub static I2C_DRIVER: Lazy<Mutex<I2cDriver<'static>>> = Lazy::new(PlantHal::create_i2c);
#[non_exhaustive]
struct V3Constants;
impl V3Constants {}
const X25: crc::Crc<u16> = crc::Crc::<u16>::new(&crc::CRC_16_IBM_SDLC);
fn deep_sleep(duration_in_ms: u64) -> ! {
@@ -132,6 +127,7 @@ pub trait BoardInteraction<'a> {
fn set_config(&mut self, config: PlantControllerConfig) -> Result<()>;
}
#[allow(dead_code)]
pub struct FreePeripherals {
pub gpio0: Gpio0,
pub gpio1: Gpio1,

View File

@@ -84,7 +84,7 @@ pub struct V3<'a> {
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
>,
shift_register_enable_invert:
_shift_register_enable_invert:
PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Output>,
tank_channel: AdcChannelDriver<'a, Gpio5, AdcDriver<'a, esp_idf_hal::adc::ADC1>>,
solar_is_day: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, esp_idf_hal::gpio::Input>,
@@ -109,7 +109,7 @@ pub(crate) fn create_v3(
esp: ESP<'static>,
config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>,
) -> Result<Box<dyn BoardInteraction + Send + '_>> {
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
let mut clock = PinDriver::input_output(peripherals.gpio15.downgrade())?;
clock.set_pull(Pull::Floating)?;
let mut latch = PinDriver::input_output(peripherals.gpio3.downgrade())?;
@@ -234,7 +234,7 @@ pub(crate) fn create_v3(
battery_monitor,
esp,
shift_register,
shift_register_enable_invert,
_shift_register_enable_invert: shift_register_enable_invert,
tank_channel,
solar_is_day,
light,

View File

@@ -38,7 +38,7 @@ const MS4: u8 = 2_u8;
const SENSOR_ON: u8 = 5_u8;
pub struct V4<'a> {
mppt_ina: SyncIna219<MutexDevice<'a, I2cDriver<'a>>, UnCalibrated>,
_mppt_ina: SyncIna219<MutexDevice<'a, I2cDriver<'a>>, UnCalibrated>,
esp: ESP<'a>,
battery_monitor: Box<dyn BatteryInteraction + Send>,
config: PlantControllerConfig,
@@ -63,12 +63,12 @@ pub struct V4<'a> {
sensor_expander: Pca9535Immediate<MutexDevice<'a, I2cDriver<'a>>>,
}
pub(crate) fn create_v4(
pub(crate) fn create_v4<'a>(
peripherals: FreePeripherals,
esp: ESP<'static>,
config: PlantControllerConfig,
battery_monitor: Box<dyn BatteryInteraction + Send>,
) -> anyhow::Result<Box<dyn BoardInteraction + Send + '_>> {
) -> anyhow::Result<Box<dyn BoardInteraction<'static> + Send>> {
let mut awake = PinDriver::output(peripherals.gpio15.downgrade())?;
awake.set_high()?;
@@ -188,7 +188,7 @@ pub(crate) fn create_v4(
println!("Shunt Current: {}", current);
let v = V4 {
mppt_ina,
_mppt_ina: mppt_ina,
esp,
awake,
tank_channel,