Skip to content
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

qingke_rt::interrupt: Fix string literal creation #2

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

agausmann
Copy link
Contributor

Test code:

#[qingke_rt::interrupt]
fn DMA1_CHANNEL2() {}

Before this patch, I get this error message:

error: attribute value must be a literal
   --> life-module/src/main.rs:196:4
    |
196 | fn DMA1_CHANNEL2() {
    |    ^^^^^^^^^^^^^

Output of cargo expand:

#[link_section = ".trap"]
# [export_name = DMA1_CHANNEL2]
#[allow(non_snake_case)]
fn DMA1_CHANNEL2() {}

Output of cargo expand after this patch (note the conversion to a string literal):

#[link_section = ".trap"]
#[export_name = "DMA1_CHANNEL2"]
#[allow(non_snake_case)]
fn DMA1_CHANNEL2() {}

@andelf
Copy link
Contributor

andelf commented Mar 27, 2024

Thanks for the fix.

@andelf andelf merged commit 0c76c52 into ch32-rs:main Mar 27, 2024
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