mirror of
https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator.git
synced 2025-02-23 17:17:08 +09:00
refactor(integrated): remove printlns in fn generate
This commit is contained in:
parent
9971774a01
commit
06a5429583
1 changed files with 1 additions and 21 deletions
|
@ -48,30 +48,10 @@ pub fn generate(xml: &path::Path, out: &path::Path) -> Result<(), Error> {
|
|||
let register_map = types::Module::from_xml_dom(doc.root_element(), xml_git_info)?;
|
||||
log::debug!("converted {register_map:?}");
|
||||
|
||||
let (maps, errors) = register_map.validate();
|
||||
let (_maps, errors) = register_map.validate();
|
||||
if !errors.is_empty() {
|
||||
return Err(Error::RegmapValidationError(errors));
|
||||
}
|
||||
// TODO: this is a temporarily implementation
|
||||
println!("address,path,name,multiple_id,modf,description");
|
||||
for (addr, reg) in maps.iter().enumerate() {
|
||||
match reg {
|
||||
Some(reg) => {
|
||||
let path = reg.0.join("/");
|
||||
let multiple_id = reg.2.map_or("".to_string(), |x| x.to_string());
|
||||
println!(
|
||||
"0x{:04x},{},{},{},{},{},",
|
||||
addr,
|
||||
path,
|
||||
reg.1.name,
|
||||
multiple_id,
|
||||
reg.1.modf,
|
||||
reg.1.desc.as_ref().map_or_else(|| "", |s| s),
|
||||
)
|
||||
}
|
||||
None => println!("0x{:04x},,,,", addr),
|
||||
}
|
||||
}
|
||||
|
||||
let files = register_map.generate_code()?;
|
||||
if log::log_enabled!(log::Level::Debug) {
|
||||
|
|
Loading…
Reference in a new issue