Skip to content

Commit f65b2d1

Browse files
Don't retry
1 parent 134ce2e commit f65b2d1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

main/imu/imu_icm20948_driver.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,7 @@ biodyn_imu_err_t biodyn_imu_icm20948_init()
276276
ESP_LOGI(TAG, "\tConfigured IMU I2C and SPI");
277277

278278
// 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-
}
279+
IMU_ERR_CHECK(init_mag());
288280
ESP_LOGI(TAG, "\tInitialized magnetometer");
289281

290282
// Initialize configuration data

0 commit comments

Comments
 (0)