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

Check if argument of SET instructions is valid #64

Merged
merged 2 commits into from
Sep 15, 2024

Conversation

jannic
Copy link
Member

@jannic jannic commented Sep 15, 2024

In response to https://matrix.to/#/!YoLPkieCYHGzdjUhOK:matrix.org/$3RzuJ-nmtaz_z1qPf3CiSzEfYGdSZ8F7Ru4skRZ_eN0?via=matrix.org&via=tchncs.de&via=mozilla.org where the poster was surprised that this doesn't work as expected:

        let prg = pio_proc::pio_asm!(
            "set x, 0x333",
            "mov isr, x",
            "mov rxfifo[0], isr",
        );

@jannic
Copy link
Member Author

jannic commented Sep 15, 2024

CI errors are already fixed in #61

Copy link
Member

@9names 9names left a comment

Choose a reason for hiding this comment

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

looks fine, just 1 nitpick comment

if arg < 0 || arg > 0x1f {
panic!("SET argument out of range: {}", arg);
}
data.reify(state) as u8
Copy link
Member

Choose a reason for hiding this comment

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

seems strange to call data.reify(state) when you've got the binding arg that you've used for the last few lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course! I didn't mean to repeat the call to reify, this was a plain oversight.

@jannic jannic merged commit 60fd8a5 into rp-rs:main Sep 15, 2024
1 check passed
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