Skip to content

Conversation

romancardenas
Copy link
Contributor

@romancardenas romancardenas commented Sep 22, 2025

Currently, riscv::pac_enum macro can potentially generate code that refers to riscv-rt. This should be avoided unless explicitly enabled by users.

This PR adds the rt and rt-v-trap features to riscv to fix this bug.

Related issues: rust-embedded/svd2rust#948

@romancardenas
Copy link
Contributor Author

This PR is ready for a review.

Fixes #344

Fixes rust-embedded/svd2rust#948 (after releasing a new version)

Some(Some(handler)) => handler(#(#handler_input),*),
_ => #default_handler(#(#handler_input),*),
}
_ => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, @romancardenas take my words with a grain of salt because I may or may not be allowed/elligible to make reviews in this crate, but seems like the _ arm handles both the external interrupts AND the cases when rt-v-trap is disabled for the core interrupts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the idea. If rt-v-trap is enabled, then an assembly vector table is generated for core interrupts. Otherwise, it generates the typical code for a direct trap handler, regardless of whether it is a core or an external interrupt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! @romancardenas thanks for addressing my reviews :)

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

Successfully merging this pull request may close these issues.

2 participants