can prepare stuff

This commit is contained in:
2025-08-14 22:10:53 +02:00
parent 7a7f000743
commit 50b2e994ca
6 changed files with 204 additions and 117 deletions

View File

@@ -5,6 +5,7 @@ mod rtc;
mod v3_hal;
mod v4_hal;
mod water;
mod v4_sensor;
use crate::hal::rtc::{DS3231Module, RTCModuleInteraction};
use crate::hal::water::TankSensor;
@@ -47,11 +48,12 @@ use once_cell::sync::Lazy;
use std::result::Result::Ok as OkStd;
use std::sync::Mutex;
use std::time::Duration;
use esp_idf_hal::can::CAN;
use esp_idf_hal::pcnt::PCNT1;
//Only support for 8 right now!
pub const PLANT_COUNT: usize = 8;
const REPEAT_MOIST_MEASURE: usize = 1;
const TANK_MULTI_SAMPLE: usize = 11;
@@ -157,6 +159,7 @@ pub struct FreePeripherals {
pub pcnt0: PCNT0,
pub pcnt1: PCNT1,
pub adc1: ADC1,
pub can: CAN,
}
impl PlantHal {
@@ -186,6 +189,7 @@ impl PlantHal {
boot_button.set_pull(Pull::Floating)?;
let free_pins = FreePeripherals {
can: peripherals.can,
adc1: peripherals.adc1,
pcnt0: peripherals.pcnt0,
pcnt1: peripherals.pcnt1,