Part 1 of V3 extraction in preperation of v4 and v3 software merge

This commit is contained in:
2025-06-08 15:59:24 +02:00
parent 3fe9aaeb6f
commit 38f4ada433
5 changed files with 634 additions and 488 deletions

View File

@@ -3,6 +3,7 @@ use chrono_tz::Tz;
use serde::{Deserialize, Serialize};
use crate::{config::PlantConfig, in_time_range, plant_hal};
use crate::plant_hal::BoardInteraction;
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
@@ -113,7 +114,7 @@ fn map_range_moisture(
impl PlantState {
pub fn read_hardware_state(
plant_id: usize,
board: &mut plant_hal::PlantCtrlBoard,
board: &mut plant_hal::HAL,
config: &PlantConfig,
) -> Self {
let sensor_a = if config.sensor_a {