rp-rs / rp2040-pac

A Rust PAC for the RP2040 Microcontroller
145 stars 28 forks source link

Prepare for release 0.6.0 #92

Closed jannic closed 8 months ago

thejpster commented 8 months ago

svd2rust is about to change the default case for fields, methods and types (see https://github.com/rust-embedded/svd2rust/pull/805). But maybe we should get 0.6 done and put that change in 0.7?

jannic commented 8 months ago

Yes, I heard about it moments after sending the merge request. If we want to do that change (l hope it's optional?) we should IMHO wait for it.

thejpster commented 8 months ago

They changed the default. You can use a config file to put it back as it was. But it's a good change! The defaults were just wrong and confusing to teach.

jannic commented 8 months ago

They changed the default. You can use a config file to put it back as it was. But it's a good change! The defaults were just wrong and confusing to teach.

I rebuilt the pac using the updated svd2rust, and I agree, the new identifier casing is more consistent. One disadvantage I see is that the old spelling was usually identical to what's used in the datasheets, so it was easier to cross-reference between documentation and code.

Anyway, this is a huge breaking change. Trying to compile an unmodified rp2040-hal with that pac ends with:

error: could not compile `rp2040-hal` (lib) due to 333 previous errors
jannic commented 8 months ago

--ident-formats-theme legacy successfully reverts to the old behavior. So we do have the option to update svd2rust, while keeping the old identifiers.

thejpster commented 8 months ago

Worse, it breaks applications that do Uart::new(p.UART0, ...) etc.

AkiyukiOkayasu commented 8 months ago

If you would like to include svd2rust's new naming scheme in pac v0.6.0, I am willing to help. I think the new naming scheme is more consistent, but we will need to carefully consider whether we should adopt it.

However, I suspect that the release will take some time, as they will be cautious about releasing it with major changes to svd2rust. I feel it would be a better idea to release pac v0.6.0 now.

burrbull commented 8 months ago

svd2rust 0.32 is released. You can use --ident-formats-theme legacy flag for old behavior. Of multiple -f flags for fine tuning.

Or use toml config. See https://github.com/stm32-rs/stm32-rs/blob/master/svd2rust.toml