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

Bitwise AND or Boolean??? #39

Open
jaggzh opened this issue Nov 17, 2021 · 1 comment
Open

Bitwise AND or Boolean??? #39

jaggzh opened this issue Nov 17, 2021 · 1 comment

Comments

@jaggzh
Copy link

jaggzh commented Nov 17, 2021

https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library/blob/master/src/heartRate.cpp#L108

In multiple places, this strange use of bitwise AND is used:

src/heartRate.cpp:108:33: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
     if ((IR_AC_Max - IR_AC_Min) > 20 & (IR_AC_Max - IR_AC_Min) < 1000)
@nseidle
Copy link
Member

nseidle commented Nov 17, 2021

Strange indeed. I believe it's a hold over from Maxim's PBA implementation. If you think it's worth fixing, a PR would be much appreciated.

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

No branches or pull requests

2 participants