SparkFun_MAX3010x_Sensor_Library icon indicating copy to clipboard operation
SparkFun_MAX3010x_Sensor_Library copied to clipboard

Bitwise AND or Boolean???

Open jaggzh opened this issue 2 years ago • 1 comments

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)

jaggzh avatar Nov 17 '21 14:11 jaggzh

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.

nseidle avatar Nov 17 '21 16:11 nseidle