-
Notifications
You must be signed in to change notification settings - Fork 72
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
Update to svd2rust 0.33.1 #155
base: main
Are you sure you want to change the base?
Conversation
This improves the generated API in various minor ways. We cannot guarantee full backwards compatibility for downstream users but the changes should not be too disrupting. Most importantly, upstream svd2rust switched to a different case style for identifiers in 0.32.0. For now, this is disabled using `--ident-formats legacy` but we should consider following their suggestion at some point in the future.
This is needed to ensure the changed versions are actually used.
Full diff (very large!): svd2rust-0.33.1-changes.diff.txt.zip "Manageable" diff of just ATmega328P: svd2rust-0.33.1-changes-atmega328p.diff.txt |
This can be fixed rather easily for cargo build --message-format json 2>/dev/null | jq '.message.children[].spans[] | {file: .file_name, line: .line_start, col: (.text[0].highlight_start - 1), insert: .suggested_replacement}' 2>/dev/null | jq -r '"sed -ri '"'"'" + (.line | tostring) + "s/^(.{" + (.col | tostring) + "})/\\1" + .insert + "/'"'"' $(cd ../..; realpath " + .file + ")"' | sort | uniq | bash (Definitely not cursed......) For reference, the diff it produces is here:
|
This improves the generated API in various ways.
The most major change seems to be from 0.31.0 where registers are now accessed using methods instead of fields. This will require rather large downstream changes.
Upstream svd2rust also switched to a different case style for identifiers in 0.32.0. For now, this is disabled using
--ident-formats legacy
but we should consider following their suggestion at some point in the future.