Skip to content

Commit

Permalink
add derivedFrom to peripheral, cluster and field makers
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnikita committed Oct 1, 2023
1 parent 70e98f4 commit af85fb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ fn modify_dim_element<T: Clone>(
fn make_field(fadd: &Hash) -> Result<FieldInfoBuilder> {
let mut fnew = FieldInfo::builder()
.description(fadd.get_string("description")?)
.derived_from(fadd.get_string("derivedFrom")?)
.access(fadd.get_str("access")?.and_then(Access::parse_str));

if let Some(name) = fadd.get_str("name")? {
Expand Down Expand Up @@ -428,6 +429,7 @@ fn make_register(radd: &Hash) -> Result<RegisterInfoBuilder> {
fn make_cluster(cadd: &Hash) -> Result<ClusterInfoBuilder> {
let mut cnew = ClusterInfo::builder()
.description(cadd.get_string("description")?)
.derived_from(cadd.get_string("derivedFrom")?)
.default_register_properties(get_register_properties(cadd)?)
.children(match cadd.get_hash("registers")? {
Some(h) => {
Expand Down Expand Up @@ -470,6 +472,7 @@ fn make_peripheral(padd: &Hash, modify: bool) -> Result<PeripheralInfoBuilder> {
.display_name(padd.get_string("displayName")?)
.version(padd.get_string("version")?)
.description(padd.get_string("description")?)
.derived_from(padd.get_string("derivedFrom")?)
.group_name(padd.get_string("groupName")?)
.interrupt(if !modify {
match padd.get_hash("interrupts")? {
Expand Down

0 comments on commit af85fb6

Please sign in to comment.