summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-08-08 08:17:23 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-08-08 08:17:23 +0200
commit4a2747f0c508cd5af830c14e43ffeaf3fe25e4e7 (patch)
treebb9895d8dca427695b6d7afe6eddd71834cfc858
parent4f09b621e12e5ecf5b34396a36556a8dca49e8cd (diff)
am2320: Fix typo and remove superfluous bitmask
-rw-r--r--src/driver/am2320.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/driver/am2320.cc b/src/driver/am2320.cc
index 25e2ffe..532fdb6 100644
--- a/src/driver/am2320.cc
+++ b/src/driver/am2320.cc
@@ -39,7 +39,7 @@ unsigned char AM2320::getStatus()
}
}
}
- if ((rxbuf[6] != (checksum & 0x00ff)) || (rxbuf[7] != (checksum >> 8) & 0x00ff)) {
+ if ((rxbuf[6] != (checksum & 0x00ff)) || (rxbuf[7] != (checksum >> 8))) {
return 3;
}
return 0;
@@ -47,7 +47,7 @@ unsigned char AM2320::getStatus()
float AM2320::getTemp()
{
- if (txbuf[5] & 0x80) {
+ if (rxbuf[5] & 0x80) {
return (-256 * (rxbuf[4] & 0x7f) + rxbuf[5]) / 10.;
}
return (256 * rxbuf[4] + rxbuf[5]) / 10.;