Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 1af609b

Browse files
committed
Fix version check disabling sgp_set_absolute_humidity
Fix the version check macro `SGP_REQUIRE_FS` that failed to shift the major version bits down prior to the comparison. This caused `sgp_set_absolute_humidity` to constantly fail on the SGP30. Based on patch by GitHub user vrubel. Thanks. #31
1 parent 9677acc commit 1af609b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sgp-common/sgp_featureset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern const u8 PROFILE_NUMBER_SET_POWER_MODE;
7676
/** Check if the chip's featureset is newer than or equal to the required one */
7777
#define SGP_REQUIRE_FS(chip_fs, major, minor) ( \
7878
( /* major version equal, minor version upwards compatible */ \
79-
(((chip_fs) & 0x00E0) == (major)) && \
79+
((((chip_fs) & 0x00E0) >> 5) == (major)) && \
8080
(((chip_fs) & 0x001F) >= (minor)) \
8181
))
8282

0 commit comments

Comments
 (0)