Skip to content

Commit 5a7b8cd

Browse files
committed
DJI OSD patch add warnings/LQ/RSSI-Dbm
1 parent 18ee33e commit 5a7b8cd

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/main/osd/osd_elements.c

+16-4
Original file line numberDiff line numberDiff line change
@@ -1123,16 +1123,16 @@ static void osdElementLinkQuality(osdElementParms_t *element)
11231123
if (linkQualitySource == LQ_SOURCE_RX_PROTOCOL_CRSF) { // 0-99
11241124
osdLinkQuality = rxGetLinkQuality();
11251125
const uint8_t osdRfMode = rxGetRfMode();
1126-
tfp_sprintf(element->buff, "%c%1d:%2d", SYM_LINK_QUALITY, osdRfMode, osdLinkQuality);
1126+
tfp_sprintf(element->buff, "LQ %1d:%03d %3d", osdRfMode, osdLinkQuality, getRssiDbm());
11271127
} else if (linkQualitySource == LQ_SOURCE_RX_PROTOCOL_GHST) { // 0-100
11281128
osdLinkQuality = rxGetLinkQuality();
1129-
tfp_sprintf(element->buff, "%c%2d", SYM_LINK_QUALITY, osdLinkQuality);
1129+
tfp_sprintf(element->buff, "LQ %03d %3d", osdLinkQuality, getRssiDbm());
11301130
} else { // 0-9
11311131
osdLinkQuality = rxGetLinkQuality() * 10 / LINK_QUALITY_MAX_VALUE;
11321132
if (osdLinkQuality >= 10) {
11331133
osdLinkQuality = 9;
11341134
}
1135-
tfp_sprintf(element->buff, "%c%1d", SYM_LINK_QUALITY, osdLinkQuality);
1135+
tfp_sprintf(element->buff, "LQ %1d", osdLinkQuality);
11361136
}
11371137
}
11381138
#endif // USE_RX_LINK_QUALITY_INFO
@@ -1475,6 +1475,18 @@ static void osdElementWarnings(osdElementParms_t *element)
14751475
}
14761476
}
14771477

1478+
static void osdElementWarnings2(osdElementParms_t *element)
1479+
{
1480+
osdElementWarnings(element);
1481+
1482+
if (strlen(element->buff) == 0) {
1483+
osdElementLinkQuality(element);
1484+
}
1485+
1486+
strncpy(pilotConfigMutable()->name, element->buff, 12);
1487+
return;
1488+
}
1489+
14781490
// Define the order in which the elements are drawn.
14791491
// Elements positioned later in the list will overlay the earlier
14801492
// ones if their character positions overlap
@@ -1591,7 +1603,7 @@ const osdElementDrawFn osdElementDrawFunction[OSD_ITEM_COUNT] = {
15911603
[OSD_YAW_PIDS] = osdElementPidsYaw,
15921604
[OSD_POWER] = osdElementPower,
15931605
[OSD_PIDRATE_PROFILE] = osdElementPidRateProfile,
1594-
[OSD_WARNINGS] = osdElementWarnings,
1606+
[OSD_WARNINGS] = osdElementWarnings2,
15951607
[OSD_AVG_CELL_VOLTAGE] = osdElementAverageCellVoltage,
15961608
#ifdef USE_GPS
15971609
[OSD_GPS_LON] = osdElementGpsCoordinate,

0 commit comments

Comments
 (0)