We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 134ce2e commit f65b2d1Copy full SHA for f65b2d1
main/imu/imu_icm20948_driver.c
@@ -276,15 +276,7 @@ biodyn_imu_err_t biodyn_imu_icm20948_init()
276
ESP_LOGI(TAG, "\tConfigured IMU I2C and SPI");
277
278
// Init magnetometer
279
- biodyn_imu_err_t err = BIODYN_IMU_OK;
280
- int tries = 0;
281
- while ((err = init_mag()) != BIODYN_IMU_OK)
282
- {
283
- if (tries > 10)
284
- return collect_err(BIODYN_IMU_ERR_COULDNT_INIT_MAG, "Failed to initialize magnetometer after multiple tries");
285
- vTaskDelay(pdMS_TO_TICKS(100));
286
- ++tries;
287
- }
+ IMU_ERR_CHECK(init_mag());
288
ESP_LOGI(TAG, "\tInitialized magnetometer");
289
290
// Initialize configuration data
0 commit comments