Skip to content

Commit 8d30bef

Browse files
committed
Fixes Incorrect mask and bit shift in readAdcRange and setAdcRange, rolls version
1 parent a69b715 commit 8d30bef

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun Bio Sensor Hub Library
2-
version=1.0.2
2+
version=1.0.3
33
author=Elias Santistevan
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for the MAX32664 Bio Metric Hub IC

src/SparkFun_Bio_Sensor_Hub_Library.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ uint8_t SparkFun_Bio_Sensor_Hub::setAdcRange(uint16_t adcVal){
544544

545545
regVal = readRegisterMAX30101(CONFIGURATION_REGISTER);
546546
regVal &= ADC_MASK;
547-
regVal |= adcVal;
547+
regVal |= (adcVal << 5);
548548

549549
writeRegisterMAX30101(CONFIGURATION_REGISTER, regVal);
550550

src/SparkFun_Bio_Sensor_Hub_Library.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#define READ_PULSE_MASK 0x03
2121
#define SAMP_MASK 0xE3
2222
#define READ_SAMP_MASK 0x1C
23-
#define ADC_MASK 0x3F
24-
#define READ_ADC_MASK 0xC0
23+
#define ADC_MASK 0x9F
24+
#define READ_ADC_MASK 0x60
2525

2626
#define ENABLE_CMD_DELAY 45 // Milliseconds
2727
#define CMD_DELAY 6 // Milliseconds

0 commit comments

Comments
 (0)