AP_InertialSensor: cleanup NAMED_VALUE_FLOAT for fifo error

This commit is contained in:
Andrew Tridgell 2023-01-19 10:07:20 +11:00 committed by Randy Mackay
parent b5549078a2
commit 6c93d1cbdb

View File

@ -458,14 +458,11 @@ bool AP_InertialSensor_Invensense::update() /* front end */
// check if we have reported in the last 1 seconds or // check if we have reported in the last 1 seconds or
// fast_reset_count changed // fast_reset_count changed
#if HAL_GCS_ENABLED && BOARD_FLASH_SIZE > 1024 #if HAL_GCS_ENABLED && BOARD_FLASH_SIZE > 1024
if (AP_HAL::millis() - last_fast_reset_count_report_ms > 1000) { const uint32_t now = AP_HAL::millis();
last_fast_reset_count_report_ms = AP_HAL::millis(); if (now - last_fast_reset_count_report_ms > 5000U) {
char param_name[sizeof("IMUx_RST")]; last_fast_reset_count_report_ms = now;
if (_gyro_instance <= 9) { char param_name[sizeof("IMUxx_RST")];
snprintf(param_name, sizeof(param_name), "IMU%u_RST", _gyro_instance); snprintf(param_name, sizeof(param_name), "IMU%u_RST", MIN(_gyro_instance,9));
} else {
snprintf(param_name, sizeof(param_name), "IMUx_RST");
}
gcs().send_named_float(param_name, fast_reset_count); gcs().send_named_float(param_name, fast_reset_count);
} }
#endif #endif