chore: cargo fmt

This commit is contained in:
2025-06-20 16:26:03 +02:00
parent 017078ef8e
commit 4b919b9613
10 changed files with 335 additions and 235 deletions

View File

@@ -23,12 +23,12 @@ use esp_idf_hal::pcnt::{
PcntChannel, PcntChannelConfig, PcntControlMode, PcntCountMode, PcntDriver, PinIndex,
};
use esp_idf_sys::{gpio_hold_dis, gpio_hold_en, vTaskDelay, EspError};
use one_wire_bus::OneWire;
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
use std::result::Result::Ok as OkStd;
use ina219::address::Address;
use ina219::calibration::{Calibration, UnCalibrated};
use ina219::SyncIna219;
use one_wire_bus::OneWire;
use pca9535::{GPIOBank, Pca9535Immediate, StandardExpanderInterface};
use std::result::Result::Ok as OkStd;
const MS0: u8 = 1_u8;
const MS1: u8 = 0_u8;
@@ -174,14 +174,19 @@ pub(crate) fn create_v4(
}
let mut mppt_ina = SyncIna219::new(MutexDevice::new(&I2C_DRIVER), Address::from_byte(68)?)?;
esp.delay.delay_ms(mppt_ina.configuration()?.conversion_time().unwrap().as_millis() as u32);
esp.delay.delay_ms(
mppt_ina
.configuration()?
.conversion_time()
.unwrap()
.as_millis() as u32,
);
println!("Bus Voltage: {}", mppt_ina.bus_voltage()?);
println!("Shunt Voltage: {}", mppt_ina.shunt_voltage()?);
let volt = (mppt_ina.shunt_voltage()?.shunt_voltage_mv()) as f32 / 1000_f32;
let current = volt /0.05;
let current = volt / 0.05;
println!("Shunt Current: {}", current);
let v = V4 {
mppt_ina,
esp,