diff options
author | JF <JF002@users.noreply.github.com> | 2022-01-26 21:39:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-26 21:39:58 +0100 |
commit | 9e9010c725bc09233b0f4d3d5edf9566fff31462 (patch) | |
tree | 78aed117fd11d4e81f6aa73caa991773ebb81a05 /src/drivers/Hrs3300.cpp | |
parent | 458f5b8eb8f165f90717d804c0b0be23d6bc5240 (diff) | |
parent | 464b689a03bca06099fba316b4c6c66c619d5521 (diff) |
Merge pull request #876 from yehoshuapw/hrs-driver-changes
Hrs driver changes
Diffstat (limited to 'src/drivers/Hrs3300.cpp')
-rw-r--r-- | src/drivers/Hrs3300.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index c14fe7aa..cfc476cb 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -54,18 +54,18 @@ void Hrs3300::Disable() { WriteRegister(static_cast<uint8_t>(Registers::Enable), value); } -uint16_t Hrs3300::ReadHrs() { +uint32_t Hrs3300::ReadHrs() { auto m = ReadRegister(static_cast<uint8_t>(Registers::C0DataM)); auto h = ReadRegister(static_cast<uint8_t>(Registers::C0DataH)); auto l = ReadRegister(static_cast<uint8_t>(Registers::C0dataL)); - return (m << 8) | ((h & 0x0f) << 4) | (l & 0x0f) | ((l & 0x30) << 12); + return ((l & 0x30) << 12) | (m << 8) | ((h & 0x0f) << 4) | (l & 0x0f); } -uint16_t Hrs3300::ReadAls() { +uint32_t Hrs3300::ReadAls() { auto m = ReadRegister(static_cast<uint8_t>(Registers::C1dataM)); auto h = ReadRegister(static_cast<uint8_t>(Registers::C1dataH)); auto l = ReadRegister(static_cast<uint8_t>(Registers::C1dataL)); - return (m << 3) | ((h & 0x3f) << 11) | (l & 0x07); + return ((h & 0x3f) << 11) | (m << 3) | (l & 0x07); } void Hrs3300::SetGain(uint8_t gain) { |