diff --git a/src/main.rs b/src/main.rs index c635b00..f799147 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,31 @@ fn main() -> ! { let core_perif = CorePeripherals::take().unwrap(); let perif = Peripherals::take().unwrap(); - let (mut wd, _flash_store, mut laser, mut thermostat,) = bootup(core_perif, perif); + let (mut wd, mut flash_store, mut laser, mut thermostat,) = bootup(core_perif, perif); + + let key = "test"; + info!("Read the Flash Content Stored"); + match flash_store.read(key).unwrap() { + Some(val) => {info!("Flash Valued Read: {:?}", val)} + _ => {info!("Key does not match")} + } + + info!("Erasing Flash"); + flash_store.erase().unwrap(); + match flash_store.read(key).unwrap() { + Some(val) => {info!("Flash Valued Read: {:?}", val)} + _ => {info!("Key does not match")} + } + + info!("Writing Flash"); + let buf = [1, 2, 3, 4]; + flash_store.write(key, &buf).unwrap(); + + info!("Reading Flash"); + match flash_store.read(key).unwrap() { + Some(val) => {info!("Val: {:?}", val)} + _ => {info!("Key does not match")} + }; // https://github.com/iliekturtles/uom/blob/master/examples/si.rs let volt_fmt = ElectricPotential::format_args(volt, Abbreviation);