Skip to content

Commit

Permalink
fix(bw): display GVar name if exist in telemetry screen (EdgeTX#4778)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored and felipemanga committed Mar 29, 2024
1 parent ffa9da1 commit 5d4fd86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions radio/src/gui/128x64/view_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ bool displayNumbersTelemetryScreen(TelemetryScreenData & screen)
drawTimerWithMode(pos[j+1] + 2, 1+FH+2*FH*i, field - MIXSRC_FIRST_TIMER, RIGHT | DBLSIZE);
continue;
}
if (field >= MIXSRC_FIRST_GVAR && field <= MIXSRC_LAST_GVAR) {
if (g_model.gvars[field - MIXSRC_FIRST_GVAR].name[0])
lcdDrawSizedText(pos[j], 1+FH+2*FH*i,g_model.gvars[field - MIXSRC_FIRST_GVAR].name, LEN_GVAR_NAME, 0);
else
drawSource(pos[j], 1+FH+2*FH*i, field, 0);
}
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
// we don't display GPS name, no space for it
att = RIGHT|DBLSIZE|NO_UNIT; //DBLSIZE ensure the telem screen specific display for GPS is used
Expand Down
6 changes: 6 additions & 0 deletions radio/src/gui/212x64/view_telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ bool displayNumbersTelemetryScreen(TelemetryScreenData & screen)
y += FH/2;
}
}
if (field >= MIXSRC_FIRST_GVAR && field <= MIXSRC_LAST_GVAR) {
if (g_model.gvars[field - MIXSRC_FIRST_GVAR].name[0])
lcdDrawSizedText(pos[j], 1+FH+2*FH*i,g_model.gvars[field - MIXSRC_FIRST_GVAR].name, LEN_GVAR_NAME, 0);
else
drawSource(pos[j], 1+FH+2*FH*i, field, 0);
}
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
// we don't display GPS name, no space for it, but we shift x by some pixel to allow it to fit on max coord
x -=2;
Expand Down

0 comments on commit 5d4fd86

Please sign in to comment.