Skip to content

Commit

Permalink
Fixes Incorrect mask and bit shift in readAdcRange and setAdcRange, r…
Browse files Browse the repository at this point in the history
…olls version
  • Loading branch information
edspark committed Apr 23, 2020
1 parent a69b715 commit 8d30bef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun Bio Sensor Hub Library
version=1.0.2
version=1.0.3
author=Elias Santistevan
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for the MAX32664 Bio Metric Hub IC
Expand Down
2 changes: 1 addition & 1 deletion src/SparkFun_Bio_Sensor_Hub_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ uint8_t SparkFun_Bio_Sensor_Hub::setAdcRange(uint16_t adcVal){

regVal = readRegisterMAX30101(CONFIGURATION_REGISTER);
regVal &= ADC_MASK;
regVal |= adcVal;
regVal |= (adcVal << 5);

writeRegisterMAX30101(CONFIGURATION_REGISTER, regVal);

Expand Down
4 changes: 2 additions & 2 deletions src/SparkFun_Bio_Sensor_Hub_Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#define READ_PULSE_MASK 0x03
#define SAMP_MASK 0xE3
#define READ_SAMP_MASK 0x1C
#define ADC_MASK 0x3F
#define READ_ADC_MASK 0xC0
#define ADC_MASK 0x9F
#define READ_ADC_MASK 0x60

#define ENABLE_CMD_DELAY 45 // Milliseconds
#define CMD_DELAY 6 // Milliseconds
Expand Down

1 comment on commit 8d30bef

@alexmstahl
Copy link

Choose a reason for hiding this comment

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

thanks for the quick response!

Please sign in to comment.