@@ -76,12 +76,11 @@ impl{{block_generics}} {{ block.name }}{{block_generics}} {
76
76
callback({{method.address}} + 0 * 0, "{{method.name}}", reg.into());
77
77
{% endwhen %}
78
78
{% when BlockMethodKind ::Repeated { count , stride } %}
79
- {% for index in 0..*count %}
80
- {{method.cfg_attr}}
81
- let reg = self.{{method.name}}({{index}}).read()?;
82
- {{method.cfg_attr}}
83
- callback({{method.address}} + {{index}} * {{stride}}, "{{method.name}}[{{index}}]", reg.into());
84
- {% endfor %}
79
+ {{method.cfg_attr}}
80
+ for index in 0..{{count}} {
81
+ let reg = self.{{method.name}}(index).read()?;
82
+ callback({{method.address}} + index as {{device.register_address_type}} * {{stride}}, "{{method.name}}", reg.into());
83
+ }
85
84
{% endwhen %}
86
85
{% endmatch %}
87
86
{% endif %}
@@ -124,12 +123,11 @@ impl{{block_generics}} {{ block.name }}{{block_generics}} {
124
123
callback({{method.address}} + 0 * 0, "{{method.name}}", reg.into());
125
124
{% endwhen %}
126
125
{% when BlockMethodKind ::Repeated { count , stride } %}
127
- {% for index in 0..*count %}
128
- {{method.cfg_attr}}
129
- let reg = self.{{method.name}}({{index}}).read_async().await?;
130
- {{method.cfg_attr}}
131
- callback({{method.address}} + {{index}} * {{stride}}, "{{method.name}}[{{index}}]", reg.into());
132
- {% endfor %}
126
+ {{method.cfg_attr}}
127
+ for index in 0..{{count}} {
128
+ let reg = self.{{method.name}}(index).read_async().await?;
129
+ callback({{method.address}} + index as {{device.register_address_type}} * {{stride}}, "{{method.name}}", reg.into());
130
+ }
133
131
{% endwhen %}
134
132
{% endmatch %}
135
133
{% endif %}
0 commit comments