Skip to content

Commit e5dcee9

Browse files
authored
Fix BMI270 detection (#103)
1 parent 5ef0dae commit e5dcee9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/imu/ImuGizmoBMI270.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ class ImuGizmoBMI270 : public ImuGizmo {
203203
_spi = spi;
204204
_csPin = csPin;
205205

206-
if(who_am_i() != 0x24) return false;
207-
208206
set_gyro_scale_dps(gyro_scale_dps);
209207
set_acc_scale_g(acc_scale_g);
210208
set_rate(rate_hz);
@@ -220,6 +218,8 @@ class ImuGizmoBMI270 : public ImuGizmo {
220218
digitalWrite(_csPin, HIGH);
221219
delay(10);
222220

221+
if(who_am_i() != 0x24) return false;
222+
223223
// Perform a soft reset to set all configuration to default
224224
// Delay 100ms before continuing configuration
225225
write_reg(BMI270_REG_CMD, BMI270_VAL_CMD_SOFTRESET);

0 commit comments

Comments
 (0)