Skip to content

Commit 93d4d05

Browse files
committed
build: Go back to the "legacy" identifier theme of svd2rust
After starting work on porting avr-hal to the new version of avr-device, I started hitting the effects of the changed identifiers in the generated API. In Rahix/avr-hal#545, commit Rahix/avr-hal@ef69e1b, I at least got to the point of getting the Arduino Uno examples to compile again. I have to say, I absolutely do not like the code churn we introduce with this. While it is probably manageable for avr-hal with team effort, that's not all: - All downstream users will have to work through the same churn of (sometimes non-trivial) identifier changes. - All current PRs in avr-hal will need to be rebased by their authors to the new style identifiers. - Legacy examples found on the web all become outdated. - Rust compiler error messages on fixing the names are quite hit-or-miss. The update strategy is not clear if you don't understand what has happened. I took a look around the ecosystem and others have also decided to stick to what svd2rust calls the "legacy" identifier theme. I am much in favor of doing the same. There is no significant advantage to doing this change now, so let's not waste huge amounts of effort on it.
1 parent 6507581 commit 93d4d05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl CodeGenerator {
266266
svd2rust_config.skip_crate_attributes = true;
267267
svd2rust_config.reexport_core_peripherals = false;
268268
svd2rust_config.reexport_interrupt = false;
269-
svd2rust_config.ident_formats = IdentFormats::default_theme();
269+
svd2rust_config.ident_formats = IdentFormats::legacy_theme();
270270

271271
let generated_stream =
272272
svd2rust::generate::device::render(&svd, &svd2rust_config, &mut String::new())

0 commit comments

Comments
 (0)