Align with removal of MemoryRegionKind::Otp
This commit is contained in:
parent
a8567f0617
commit
c848bd9c9c
@ -109,9 +109,9 @@ fn main() {
|
|||||||
let flash_memory_regions = METADATA
|
let flash_memory_regions = METADATA
|
||||||
.memory
|
.memory
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|x| x.kind == MemoryRegionKind::Flash || x.kind == MemoryRegionKind::Otp);
|
.filter(|x| x.kind == MemoryRegionKind::Flash && x.settings.is_some());
|
||||||
for region in flash_memory_regions.clone() {
|
for region in flash_memory_regions.clone() {
|
||||||
let region_name = format_ident!("{}", region.name);
|
let region_name = format_ident!("{}", region.name.replace("_", ""));
|
||||||
let base = region.address as usize;
|
let base = region.address as usize;
|
||||||
let size = region.size as usize;
|
let size = region.size as usize;
|
||||||
let settings = region.settings.as_ref().unwrap();
|
let settings = region.settings.as_ref().unwrap();
|
||||||
@ -136,8 +136,9 @@ fn main() {
|
|||||||
|
|
||||||
let (fields, inits): (Vec<TokenStream>, Vec<TokenStream>) = flash_memory_regions
|
let (fields, inits): (Vec<TokenStream>, Vec<TokenStream>) = flash_memory_regions
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let field_name = format_ident!("{}", f.name.to_lowercase());
|
let trimmed_name = f.name.replace("_", "");
|
||||||
let field_type = format_ident!("{}", f.name);
|
let field_name = format_ident!("{}", trimmed_name.to_lowercase());
|
||||||
|
let field_type = format_ident!("{}", trimmed_name);
|
||||||
let field = quote! {
|
let field = quote! {
|
||||||
pub #field_name: #field_type
|
pub #field_name: #field_type
|
||||||
};
|
};
|
||||||
@ -629,10 +630,10 @@ fn main() {
|
|||||||
for m in METADATA
|
for m in METADATA
|
||||||
.memory
|
.memory
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|m| m.kind == MemoryRegionKind::Flash || m.kind == MemoryRegionKind::Otp)
|
.filter(|m| m.kind == MemoryRegionKind::Flash && m.settings.is_some())
|
||||||
{
|
{
|
||||||
let mut row = Vec::new();
|
let mut row = Vec::new();
|
||||||
row.push(m.name.to_string());
|
row.push(m.name.replace("_", ""));
|
||||||
flash_regions_table.push(row);
|
flash_regions_table.push(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user