Skip to content

Commit df2b6b0

Browse files
committed
LPS28DFW: log reasons for failures
1 parent 36a4c89 commit df2b6b0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_LPS28DFW.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ class WipperSnapper_I2C_Driver_LPS28DFW : public WipperSnapper_I2C_Driver {
6363
return false;
6464

6565
// Set up sample rate and filter initialization
66-
_lps28->setDataRate(LPS28_ODR_ONESHOT);
67-
_lps28->setAveraging(LPS28_AVG_512);
66+
if (!_lps28->setDataRate(LPS28_ODR_ONESHOT)) {
67+
WS_DEBUG_PRINTLN("Failed to set data rate");
68+
return false;
69+
}
70+
if (!_lps28->setAveraging(LPS28_AVG_512)) {
71+
WS_DEBUG_PRINTLN("Failed to set averaging");
72+
return false;
73+
}
6874

69-
return readSensor();
75+
return true;
7076
}
7177

7278
/*******************************************************************************/

0 commit comments

Comments
 (0)