Conversation
The status command printed OK for gyro, accelerometer and compass as soon as the sensor was detected and healthy, even when it had never been calibrated. Users troubleshooting a navigation unsafe condition got no hint from the one command they are usually asked to run. Report UNCALIBRATED for those three sensors when they are detected and healthy but not calibrated, using the calibration state the firmware already tracks. All other states are unchanged, and hardwareSensorStatus_e is left alone so MSP_SENSOR_STATUS and the two bit per sensor blackbox packing keep their current values. Fixes iNavFlight#9997
Raffi1202
marked this pull request as ready for review
September 11, 2026 15:48
Contributor
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoReport uncalibrated sensors in CLI status
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can switch off images and animations for a plain-text comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #9997: the CLI
statuscommand printsGYRO=OK, ACC=OK, MAG=OKas soon as a sensor is detected and healthy, even when it has never been calibrated. A user whose navigation modes refuse to arm because of a missing calibration gets no hint from the one command they are usually asked to run. The reporter asked forUNCALIBRATEDinstead ofOKfor compass, accelerometer and gyro.Cause
src/main/fc/cli.c:4187-4190on maintenance-10.x: the sensor line indexeshardwareSensorStatusNames[](cli.c:253, valuesNONE/OK/UNAVAILABLE/FAILINGfromhardwareSensorStatus_einsrc/main/sensors/diagnostics.h:12) with the hardware health status only. Calibration state is never consulted, so a healthy but uncalibrated sensor printsOK.Change
Adds a static helper
hardwareSensorStatusName(status, isCalibrated)incli.cthat returns"UNCALIBRATED"when the status isHW_SENSOR_OKand the sensor is not calibrated, and the existing name otherwise.cliStatus()uses it for GYRO, ACC and MAG withgyroIsCalibrationComplete(),STATE(ACCELEROMETER_CALIBRATED)(the same flagfc_core.c:296uses for the arming block) andcompassIsCalibrationComplete()(treated as calibrated whenUSE_MAGis not built).hardwareSensorStatus_eis unchanged, soMSP_SENSOR_STATUS(fc_msp.c:512) and the two-bit blackbox packing (blackbox.c:1491) keep their values.Test
Not run on hardware or SITL. Cause verified by reading
cli.c:4187-4190and the three calibration functions on maintenance-10.x;Flash / RAM
Not measured yet. The upstream firmware CI has not been released for this PR, so no size report exists.
Docs
No documentation change needed:
docs/Cli.md:124listsstatusonly as "Show status" and no file underdocs/enumerates the sensor status words.