Skip to content

Commit 4d95781

Browse files
committed
Fixed hang due to consecutive read tempurature
fix the hang issue due to consecutive reads of the temperature register porting of arduino-libraries/Arduino_MKRENV#6
1 parent 990f981 commit 4d95781

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HTS.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ float HTS221Class::readTemperature(int units)
7676
i2cWrite(HTS221_CTRL2_REG, 0x01);
7777

7878
// wait for completion
79-
while ((i2cRead(HTS221_STATUS_REG) & 0x01) == 0) {
79+
while ((i2cRead(HTS221_STATUS_REG) & 0x03) == 0) {
8080
yield();
8181
}
8282

@@ -96,7 +96,7 @@ float HTS221Class::readHumidity()
9696
i2cWrite(HTS221_CTRL2_REG, 0x01);
9797

9898
// wait for completion
99-
while ((i2cRead(HTS221_STATUS_REG) & 0x02) == 0) {
99+
while ((i2cRead(HTS221_STATUS_REG) & 0x03) == 0) {
100100
yield();
101101
}
102102

0 commit comments

Comments
 (0)