Skip to content

Generated code doesn't work #487

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

Closed
thejpster opened this issue Jan 24, 2021 · 5 comments
Closed

Generated code doesn't work #487

thejpster opened this issue Jan 24, 2021 · 5 comments

Comments

@thejpster
Copy link
Contributor

thejpster commented Jan 24, 2021

I built a PAC using svd2rust 0.17 and it didn't compile (https://github.com/rp-rs/rp2040-pac).

I had to:

  • Remove a bunch of lints that rustc 1.49 didn't like
  • Replace bare_metal::Nr with cortex_m::interrupt::Nr

I also really struggled with the docs, which in the SVD are full of \n character pairs. It would really help if svd2rust could process out these character pairs and split the docs into multiple lines.

@thejpster
Copy link
Contributor Author

I can confirm that head works fine. See https://github.com/rp-rs/rp2040-pac/tree/use_svd_0.18alpha

@therealprof
Copy link
Contributor

We were just discussing this on the rp-rs channel and @adamgreig mentioned that the \n are not really supposed to be there. We might try to filter them out in the parser if it's not too painful/expensive.

@thejpster
Copy link
Contributor Author

I tried to do it in the generated output with sed and it was not easy at all (because you use #[doc=""] not ///). Filtering the string before it's rendered as docs would be best.

At least they didn't use Doxygen syntax in the comments 😂

@therealprof
Copy link
Contributor

There's unfortunately no way to generate /// doc strings, it's a long pet peeve of mine dtolnay/proc-macro2#205

@burrbull
Copy link
Member

Is this still actual?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants