Conversation
The receiver transmit power is only written by the MSP and MAVLink RC paths. The CRSF link statistics frame 0x14 has no such field and no other CRSF frame is parsed for it, so with an ExpressLRS receiver the element showed a permanent 0 mW. ExpressLRS never sends the optional link statistics RX frame 0x1C that would carry a power value, so parsing it would not populate the element either. A power of 0 already means "not reported" on the other paths, so skip drawing the element in that case. Fixes iNavFlight#11136
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Code Review by Qodo
1.
|
PR Summary by QodoHide unavailable receiver downlink power from the OSD
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Problem
On an ExpressLRS receiver (BetaFPV SuperD 2.4, INAV 8.0.1, Matek H743 V3) the OSD element
OSD_RX_POWER_DOWNLINKshows0 mWalthough the receiver transmits telemetry at 100 mW. The reporter expected the real value. Fixes #11136.Cause
src/main/io/osd.c:2851on maintenance-10.x printsrxLinkStatistics.downlinkTXPowerunconditionally. The field is only written bysrc/main/fc/fc_msp.c:3475(MSP2_COMMON_SET_MSP_RC_INFO) andsrc/main/fc/fc_mavlink.c:350(mLRS radio link information). The CRSF parser handles only link statistics frame 0x14 (src/main/rx/crsf.c:235-250), whose payload (crsf.c:113-124) carriesuplinkTXPowerbut no downlink power, so on CRSF the field keeps its initial 0.Change
In
osdDrawSingleElement()theOSD_RX_POWER_DOWNLINKcase blanks the six-character field and returnsfalsewhendownlinkTXPower == 0, soosdDrawNextElement()(osd.c:4270) moves on to the next element. Zero already means "not reported" on the other paths:mavlinkDbmToMilliwatts()(fc_mavlink.c:214-221) returns 0 forINT8_MAXand for anything at or below 0 dBm. The blank write (fe5ea81) removes a previously drawn value when an MSP or MAVLink link stops reporting it.docs/OSD.mdgets a note on the element.Test
Not run on hardware or SITL. Cause verified by reading
crsf.c:113-124andcrsf.c:235-250on maintenance-10.x:downlinkTXPowerhas no CRSF writer. Built by fork CI: pending. The upstream "Build firmware" run is waiting for maintainer approval (https://github.com/iNavFlight/inav/actions/runs/34619647336). Qodo's single finding (stale characters after the value drops to 0) is covered by the blank write in fe5ea81.Flash / RAM
Not measured yet. The upstream firmware CI has not been released for this PR, so no size report exists.
Docs
docs/OSD.md: theOSD_RX_POWER_DOWNLINKrow now states that the element is hidden unless the RC link reports the receiver's transmit power (MSP and MAVLink do, CRSF does not).