Closed bjoernQ closed 2 years ago
Yes. Those functions are not equivalent. And I'm really surprised someone already used one of them. const-generic version just takes bitOffset, not field number. In 0.23 those function were both present in generated code. Numeric version always, const-generic under feature. I've deleted first one during refactoring. If you need it I could try to return it back, but it will take time.
Thanks for the quick reply. I will look into our code and we can most probably work around it.
The behavior of the const-generic version is at least surprising and we started using them when we upgraded to 0.24.0 and found the numeric version removed - we just assumed it's equivalent
No idea if this will cause similar confusion for others and if it would be better to re-add the old functionality
Closing this since it's working as intended
We have a register containing a field like this
When generating code with 0.23.0 this code produces the expected output:
The output is
With svd2rust 0.23.0: 10000000000000000000000000000000
However, generating code from the same SVD with 0.24.0 the following code
outputs
00000000000000000000000010000000
Apparently, it's ignoring the
bitOffset
of the field.I created a repo to reproduce this: https://github.com/bjoernQ/svd2rust_test
Maybe I'm doing something obvious wrong but it looks like a bug to me.