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

bitWrite macro does not enclose argument in () #153

Closed
positron96 opened this issue Aug 24, 2021 · 1 comment · Fixed by #154
Closed

bitWrite macro does not enclose argument in () #153

positron96 opened this issue Aug 24, 2021 · 1 comment · Fixed by #154
Labels

Comments

@positron96
Copy link
Contributor

#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))

Current version does not wrap arguments in "()", so it works incorrectly when used like this:

bitWrite(var, bit, cond?1:0);

Some cores probably copied this header, as seen in stm32 and esp32

@facchinm
Copy link
Member

Hi @positron96 ,
thanks for spotting this! would you mind submitting a PR with the fix so we can give the proper attribution?

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

Successfully merging a pull request may close this issue.

2 participants