mirror of
https://gitlab.cern.ch/wotsubo/endcap-sl-software-ri-generator.git
synced 2025-06-07 21:45:44 +09:00
fix(converter): prepend "val_" to avoid name confliction with register obj
This commit is contained in:
parent
3379babe12
commit
e6f09d684a
1 changed files with 4 additions and 2 deletions
|
@ -514,9 +514,10 @@ impl Field {
|
|||
})
|
||||
}
|
||||
|
||||
/// Generate Field from Registers (piracy), guessing a lot of parameters.
|
||||
/// Generate virtual Field from Registers node (piracy), guessing a lot of parameters.
|
||||
pub(crate) fn from_xml_register_dom(node: Node) -> Result<Self, DomConversionError> {
|
||||
let name = util::get_name(node)?;
|
||||
// Prepend "val_" to avoid name confliction with struct for accessing values
|
||||
let name = "val_".to_string() + &util::get_name(node)?;
|
||||
let mask = match node.attribute("mask") {
|
||||
Some(mask) => mask
|
||||
.parse_prefixed_u32()
|
||||
|
@ -539,6 +540,7 @@ impl Field {
|
|||
node,
|
||||
));
|
||||
}
|
||||
// Duplicated with parent (register) desc so should be removed, or add some comment?
|
||||
let desc = node.attribute("desc").map(str::to_string);
|
||||
let children = node
|
||||
.children()
|
||||
|
|
Loading…
Add table
Reference in a new issue