small adjustments

This commit is contained in:
2025-09-16 22:41:45 +02:00
parent 1c84cd00da
commit 8b938e7687
3 changed files with 38 additions and 20 deletions

View File

@@ -44,6 +44,7 @@ use esp_hal::rng::Rng;
use esp_hal::timer::timg::TimerGroup;
use esp_storage::FlashStorage;
use esp_wifi::{init, EspWifiController};
use littlefs2::fs::Filesystem;
//Only support for 8 right now!
pub const PLANT_COUNT: usize = 8;
@@ -274,12 +275,21 @@ impl PlantHal {
};
let ota_next = mk_static!(PartitionEntry, ota_partition);
let storage_ota_next = mk_static!(FlashStorage, FlashStorage::new());
let ota_next = mk_static!(
FlashRegion<FlashStorage>,
ota_next.as_embedded_storage(storage_ota_next)
ota_next.as_embedded_storage(storage_ota)
);
let data_partition = pt
.find_partition(esp_bootloader_esp_idf::partitions::PartitionType::Data(
DataPartitionSubType::LittleFs,
))?
.unwrap();
let mut data = data_partition.as_embedded_storage(storage_ota);
let mut alloc = Filesystem::allocate();
let mut fs = Filesystem::mount(&mut alloc, &mut data).unwrap();
let mut esp = Esp {
rng,
controller: Arc::new(Mutex::new(controller)),