feat(bw128): display RSSI/RQly on 4th line of telemetry screen when not used (#6936)
This commit is contained in:
@@ -32,10 +32,11 @@ void displayRssiLine()
|
|||||||
{
|
{
|
||||||
if (TELEMETRY_STREAMING()) {
|
if (TELEMETRY_STREAMING()) {
|
||||||
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
|
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
|
||||||
uint8_t rssi;
|
rxStatStruct *rxStat = getRxStatLabels();
|
||||||
rssi = min((uint8_t)99, TELEMETRY_RSSI());
|
uint8_t rssi = min(rxStat->max, TELEMETRY_RSSI());
|
||||||
lcdDrawNumber(LCD_W/2 -2, STATUS_BAR_Y, rssi, LEADING0 | RIGHT | SMLSIZE, 2);
|
lcdDrawNumber(LCD_W/2 -2, STATUS_BAR_Y, rssi, LEADING0 | RIGHT | SMLSIZE, 2);
|
||||||
lcdDrawText(lcdLastLeftPos,STATUS_BAR_Y, "RSSI : ", RIGHT | SMLSIZE);
|
lcdDrawText(lcdLastLeftPos, STATUS_BAR_Y, ": ", RIGHT | SMLSIZE);
|
||||||
|
lcdDrawText(lcdLastLeftPos, STATUS_BAR_Y, rxStat->label, RIGHT | SMLSIZE);
|
||||||
lcdDrawRect(65, 57, 38, 7);
|
lcdDrawRect(65, 57, 38, 7);
|
||||||
uint8_t v = 4*rssi/11;
|
uint8_t v = 4*rssi/11;
|
||||||
lcdDrawFilledRect(66+36-v, 58, v, 5, (rssi < g_model.rfAlarms.warning) ? DOTTED : SOLID);
|
lcdDrawFilledRect(66+36-v, 58, v, 5, (rssi < g_model.rfAlarms.warning) ? DOTTED : SOLID);
|
||||||
@@ -108,7 +109,7 @@ bool displayNumbersTelemetryScreen(TelemetryScreenData & screen)
|
|||||||
fields_count++;
|
fields_count++;
|
||||||
}
|
}
|
||||||
if (i==3) {
|
if (i==3) {
|
||||||
if (!TELEMETRY_STREAMING()) {
|
if (!TELEMETRY_STREAMING() || (screen.lines[i].sources[0] == 0 && screen.lines[i].sources[1] == 0)) {
|
||||||
displayRssiLine();
|
displayRssiLine();
|
||||||
return fields_count;
|
return fields_count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
// default to RSSI/db notation
|
// default to RSSI/db notation
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RSSI;
|
rxStat.label = STR_RXSTAT_LABEL_RSSI;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_DBM;
|
rxStat.unit = STR_RXSTAT_UNIT_DBM;
|
||||||
|
rxStat.max = 99;
|
||||||
|
|
||||||
// Currently we can only display a single rx stat in settings/telemetry.
|
// Currently we can only display a single rx stat in settings/telemetry.
|
||||||
// If both modules are used we choose the internal one
|
// If both modules are used we choose the internal one
|
||||||
@@ -115,6 +116,7 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
multiProtocol == MODULE_SUBTYPE_MULTI_MLINK) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
|
rxStat.max = 100;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
#endif
|
#endif
|
||||||
@@ -122,6 +124,7 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
if (g_model.moduleData[moduleToUse].subType == PPM_PROTO_TLM_MLINK) {
|
if (g_model.moduleData[moduleToUse].subType == PPM_PROTO_TLM_MLINK) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
|
rxStat.max = 100;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -129,6 +132,7 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
case MODULE_TYPE_GHOST:
|
case MODULE_TYPE_GHOST:
|
||||||
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
rxStat.label = STR_RXSTAT_LABEL_RQLY;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
rxStat.unit = STR_RXSTAT_UNIT_PERCENT;
|
||||||
|
rxStat.max = 100;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if defined(RADIO_NV14_FAMILY) && defined(AFHDS2)
|
#if defined(RADIO_NV14_FAMILY) && defined(AFHDS2)
|
||||||
@@ -139,6 +143,7 @@ rxStatStruct *getRxStatLabels() {
|
|||||||
if (NV14internalModuleFwVersion >= 0x1000E) {
|
if (NV14internalModuleFwVersion >= 0x1000E) {
|
||||||
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
rxStat.label = STR_RXSTAT_LABEL_SIGNAL;
|
||||||
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT;
|
rxStat.unit = STR_RXSTAT_UNIT_NOUNIT;
|
||||||
|
rxStat.max = 99;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ void frskyDSetDefault(int index, uint16_t id);
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
const char *label;
|
const char *label;
|
||||||
const char *unit;
|
const char *unit;
|
||||||
|
uint8_t max;
|
||||||
} rxStatStruct;
|
} rxStatStruct;
|
||||||
|
|
||||||
rxStatStruct *getRxStatLabels();
|
rxStatStruct *getRxStatLabels();
|
||||||
|
|||||||
Reference in New Issue
Block a user