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

@@ -2,8 +2,8 @@ use chrono::{DateTime, TimeDelta, Utc};
use chrono_tz::Tz;
use serde::{Deserialize, Serialize};
use crate::{config::PlantConfig, in_time_range};
use crate::hal::{BoardInteraction, Sensor, HAL};
use crate::{config::PlantConfig, in_time_range};
const MOIST_SENSOR_MAX_FREQUENCY: f32 = 7500.; // 60kHz (500Hz margin)
const MOIST_SENSOR_MIN_FREQUENCY: f32 = 150.; // this is really, really dry, think like cactus levels
@@ -112,10 +112,7 @@ fn map_range_moisture(
}
impl PlantState {
pub fn read_hardware_state(
plant_id: usize,
board: &mut HAL
) -> Self {
pub fn read_hardware_state(plant_id: usize, board: &mut HAL) -> Self {
let sensor_a = if board.board_hal.get_config().plants[plant_id].sensor_a {
match board.board_hal.measure_moisture_hz(plant_id, Sensor::A) {
Ok(raw) => match map_range_moisture(