Skip to content

Commit

Permalink
fix(sensors): correctly mask capdac value (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsinapi authored Nov 10, 2022
1 parent f114586 commit d208778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/sensors/core/fdc1004.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ inline auto update_offset(float capacitance_pf, float current_offset_pf)
}

inline constexpr auto device_configuration_msb(uint8_t capdac_raw) -> uint8_t {
return (DEVICE_CONFIGURATION_MSB | ((capdac_raw >> 3) & 0x7));
return (DEVICE_CONFIGURATION_MSB | ((capdac_raw >> 3) & 0x3));
}

inline constexpr auto device_configuration_lsb(uint8_t capdac_raw) -> uint8_t {
Expand Down

0 comments on commit d208778

Please sign in to comment.