Compare commits
1
Commits
d70b35dd92
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7b8586424
|
+8
-8
@@ -6,7 +6,7 @@ use esp_hal::peripherals::FLASH;
|
||||
use esp_storage::FlashStorage;
|
||||
use int_enum::IntEnum;
|
||||
use sequential_storage::{
|
||||
cache::Cache,
|
||||
cache::{Cache, Uncached},
|
||||
map::{Key, MapConfig, MapStorage, SerializationError},
|
||||
};
|
||||
|
||||
@@ -21,18 +21,18 @@ impl ConfigCommand {
|
||||
pub static CONFIG_SERVICE: RpcService<CriticalSectionRawMutex, ConfigCommand, ()> =
|
||||
RpcService::new();
|
||||
|
||||
pub fn start_config(spawner: Spawner, flash: FLASH<'static>) {
|
||||
spawner.spawn(config_handler(flash).unwrap());
|
||||
}
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn config_handler(flash: FLASH<'static>) {
|
||||
let mut storage = MapStorage::<ConfigKey, _, _>::new(
|
||||
pub async fn start_config(spawner: Spawner, flash: FLASH<'static>) {
|
||||
let storage = MapStorage::<ConfigKey, _, _>::new(
|
||||
BlockingAsync::new(FlashStorage::new(flash)),
|
||||
const { MapConfig::new(0x3F_0000..0x40_0000) },
|
||||
Cache::new_uncached(),
|
||||
);
|
||||
|
||||
spawner.spawn(config_handler(storage).unwrap());
|
||||
}
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn config_handler(mut storage: MapStorage<ConfigKey, BlockingAsync<FlashStorage<'static>>, Cache<Uncached, Uncached, Uncached, ConfigKey>>) {
|
||||
let mut data_buffer = [0u8; 256];
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user