From dd949a1be10d4e66e16ac70ceca1015d810e06e5 Mon Sep 17 00:00:00 2001 From: Empire Date: Wed, 29 Nov 2023 18:28:09 +0100 Subject: [PATCH] partition table --- rust/partitions.csv | 5 +++++ rust/src/config.rs | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 rust/partitions.csv create mode 100644 rust/src/config.rs diff --git a/rust/partitions.csv b/rust/partitions.csv new file mode 100644 index 0000000..303718c --- /dev/null +++ b/rust/partitions.csv @@ -0,0 +1,5 @@ +nvs, data, nvs, 0x9000, 0x4000, +otadata, data, ota, 0xd000, 0x2000, +phy_init, data, phy, 0xf000, 0x1000, +ota_0, app, ota_0, 0x10000, 0x180000, +ota_1, app, ota_1, 0x190000, 0x180000, \ No newline at end of file diff --git a/rust/src/config.rs b/rust/src/config.rs new file mode 100644 index 0000000..55cb978 --- /dev/null +++ b/rust/src/config.rs @@ -0,0 +1,24 @@ + + +use crate::PLANT_COUNT; +pub struct Config { + ssid: heapless::String<32>, + password: Option>, + + tank_sensor_enabled: bool, + tank_full_ml: u32, + tank_warn_percent: u8, + + plantcount: u16, + + pump_duration_ms: [u16;PLANT_COUNT], + pump_cooldown_min: [u16;PLANT_COUNT], + pump_hour_start: [u8;PLANT_COUNT], + pump_hour_end: [u8;PLANT_COUNT], + + night_lamp_hour_start: u8, + night_lamp_hour_end: u8, + night_lamp_only_when_dark: u8 + + +} \ No newline at end of file