We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c0ba35 commit d3d6bacCopy full SHA for d3d6bac
src/BARO.cpp
@@ -57,8 +57,8 @@ float LPS22HBClass::readPressure(int units)
57
// trigger one shot
58
i2cWrite(LPS22HB_CTRL2_REG, 0x01);
59
60
- // wait for completion
61
- while ((i2cRead(LPS22HB_STATUS_REG) & 0x02) == 0) {
+ // wait for ONE_SHOT bit to be cleared by the hardware
+ while ((i2cRead(LPS22HB_CTRL2_REG) & 0x01) != 0) {
62
yield();
63
}
64
0 commit comments