Add MAX_ERASE_SIZE const in build script, and use it in flash-wide implementation of embedded-storage traits

This commit is contained in:
Mathias
2023-04-18 15:49:33 +02:00
parent 1c68c62ebd
commit 095f5ef279
3 changed files with 12 additions and 3 deletions

View File

@ -255,6 +255,14 @@ fn main() {
];
});
let max_erase_size = flash_memory_regions
.iter()
.map(|region| region.settings.as_ref().unwrap().erase_size)
.max()
.unwrap();
g.extend(quote! { pub const MAX_ERASE_SIZE: u32 = #max_erase_size });
g.extend(quote! { pub mod flash_regions { #flash_regions } });
// ========