Update main simulator routines for multi-flash
This adds an initial device with multiple flash (nrf52840 + SPI flash)
and updates all test routines to use a HashMap of flash devices (added
as type SimFlashMap).
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/simflash/src/lib.rs b/sim/simflash/src/lib.rs
index 1e9876c..df1020e 100644
--- a/sim/simflash/src/lib.rs
+++ b/sim/simflash/src/lib.rs
@@ -14,6 +14,7 @@
use std::iter::Enumerate;
use std::path::Path;
use std::slice;
+use std::collections::HashMap;
use pdump::HexDump;
error_chain! {
@@ -130,6 +131,8 @@
}
+pub type SimFlashMap = HashMap<u8, SimFlash>;
+
impl Flash for SimFlash {
/// The flash drivers tend to erase beyond the bounds of the given range. Instead, we'll be
/// strict, and make sure that the passed arguments are exactly at a sector boundary, otherwise