summaryrefslogtreecommitdiff
path: root/src/drivers/Hrs3300.cpp
diff options
context:
space:
mode:
authorYehoshua Pesach Wallach <yehoshuapw@gmail.com>2021-12-13 10:47:52 (GMT)
committerYehoshua Pesach Wallach <yehoshuapw@gmail.com>2021-12-13 10:47:52 (GMT)
commit464b689a03bca06099fba316b4c6c66c619d5521 (patch)
tree56ee0498a93b0dae1444726ddb9875ff64d01498 /src/drivers/Hrs3300.cpp
parent4cc95091ab07f0b90c078f087f3826e845443873 (diff)
changed ReadHrs and ReadAls to uint32, and did static_cast instead of hidden cast when using it
Diffstat (limited to 'src/drivers/Hrs3300.cpp')
-rw-r--r--src/drivers/Hrs3300.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp
index 45458ad..cfc476c 100644
--- a/src/drivers/Hrs3300.cpp
+++ b/src/drivers/Hrs3300.cpp
@@ -54,14 +54,14 @@ 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 ((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));