I just noticed a very weird thing: inconsistent order of impl_proxy:
I take a look at device.rs and util.rs, and I assume the order should be u8 u16 u32 u64. But I don't know what lead to the weird result.
// util.rs
pub fn get_register_sizes(d: &Device) -> Vec<u32> {
let mut reg_sizes = HashSet::new();
for p in &d.peripherals {
for r in p.all_registers() {
if let Some(size) = r.properties.size {
reg_sizes.insert(size);
}
}
}
let mut reg_sizes: Vec<_> = reg_sizes.into_iter().collect();
reg_sizes.sort();
reg_sizes
}
// device.rs
let reg_sizes = util::get_register_sizes(d);
let generic_file = std::str::from_utf8(include_bytes!("generic.rs"))?;
if config.generic_mod {
let mut file = File::create(config.output_dir.join("generic.rs"))?;
writeln!(file, "{}", generic_file)?;
for ty in reg_sizes {
writeln!(file, "impl_proxy!({});", ty.size_to_str()?)?;
}
I just noticed a very weird thing: inconsistent order of
impl_proxy
:I take a look at
device.rs
andutil.rs
, and I assume the order should beu8 u16 u32 u64
. But I don't know what lead to the weird result.