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 d7c7f8e commit 52d8e70Copy full SHA for 52d8e70
src/BMI270.cpp
@@ -73,6 +73,8 @@ int BoschSensorClass::begin() {
73
print_rslt(rslt);
74
75
_initialized = true;
76
+
77
+ return 1;
78
}
79
80
@@ -157,10 +159,15 @@ float BoschSensorClass::gyroscopeSampleRate() {
157
159
// Magnetometer
158
160
int BoschSensorClass::readMagneticField(float& x, float& y, float& z) {
161
struct bmm150_mag_data mag_data;
- bmm150_read_mag_data(&mag_data, &bmm1);
162
+ int const rc = bmm150_read_mag_data(&mag_data, &bmm1);
163
x = mag_data.x;
164
y = mag_data.y;
165
z = mag_data.z;
166
167
+ if (rc == BMM150_OK)
168
169
+ else
170
+ return 0;
171
172
173
int BoschSensorClass::magneticFieldAvailable() {
0 commit comments