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

gpio consts #91

Merged
merged 1 commit into from
Jul 29, 2019
Merged

gpio consts #91

merged 1 commit into from
Jul 29, 2019

Conversation

burrbull
Copy link
Member

cc @therealprof

Can this affect on debug builds?

@therealprof
Copy link
Member

@burrbull I don't think it will. Variables are automatically const by default unless they're mut, so IIRC to the compiler they're pretty much the same thing.

@burrbull
Copy link
Member Author

I see other:

example with consts without consts
blinky 14182 14594
led 5042 5454
pwm_custom 18538 19246

@therealprof
Copy link
Member

Interesting, guess I'll have to revisit this then; maybe in dev mode there's some special handling which removes the explicit assignment, much like #[inline(always)] would.

Anyway, I don't object to your PR, especially with those nasty macros being explicit can be a good thing.

Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM

@therealprof therealprof merged commit ecbe3d9 into stm32-rs:master Jul 29, 2019
@burrbull burrbull deleted the gpio-const branch July 29, 2019 08:35
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