-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svd2rust does not handle aliased enumeratedValues #194
Comments
Hey @jscarrott - I think that this is because they have an old aliased name in the SVD. I had a similar problem with my bindings for the nrf52832: nrf-rs/nrf52832-pac@f27102a My approach was to modify the SVD file, since it is not possible to have the two match statements resolve bidirectionally. Let me know if that is an acceptable workaround for you. |
Yeah, I'm sure that's fine. I'm just tinkering around with the board for fun and to teach myself about embedded rust and with the very vague goal of getting it to transmit some MQTT stuff over Bluetooth. I'm going to take the opportunity to thank you for the great documentation on embedded rust with svd2rust. It's been a real learning curve getting some LEDs to turn on over the weekend but with the documentation on svd2rust and @japaric's blog, the answers were never too far away. The next thing to work out though is why the LEDs only turn on after I reset the board and not when my code runs.... |
I can't take any credit for the docs, but if you want to chat about Rust, the nRF family, and misc IoT stuff, feel free to email me (its in my profile), or catch up with us on I'm going to change the title to be a little more broad, we may still decide to "gracefully" handle this issue in the future. |
I believe this is fixed by new svd-parser in #317, please re-open if the issue persists. |
When using svd2rust on the nRF52840.svd file the generated code contains an unreachable pattern and won't build without adding allow(unreachable_patterns) to the library.
error: unreachable pattern --> /home/jscarrott/Git/nrf52840/src/lib.rs:29983:21 | 29983 | 216 => TXPOWERR::NEG40DBM, | ^^^ | note: lint level defined here --> /home/jscarrott/Git/nrf52840/src/lib.rs:1:487
I've ended up just adding the allow for now and using it anyway.
The text was updated successfully, but these errors were encountered: