Skip to content

Commit

Permalink
Fix overlapping of GPS message on screen carousel #1 (#2314)
Browse files Browse the repository at this point in the history
* Fix overlapping of GPS message on screen carousel #1

* Any reason we shouldn't display this on a RAK w/ E-ink or similar non-PMU equipped boards?

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
  • Loading branch information
code8buster and thebentern committed Mar 1, 2023
1 parent 9008c75 commit 2fe5eae
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,18 +518,12 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus
// Draw status when gps is disabled by PMU
static void drawGPSpowerstat(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps)
{
#ifdef HAS_PMU
String displayLine = "GPS disabled";
int16_t xPos = display->getStringWidth(displayLine);

if (!config.position.gps_enabled) {
display->drawString(x + xPos, y, displayLine);
#ifdef GPS_POWER_TOGGLE
display->drawString(x + xPos, y - 2 + FONT_HEIGHT_SMALL, " by button");
#endif
// display->drawString(x + xPos, y + 2, displayLine);
}
#endif
}

static void drawGPSAltitude(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps)
Expand Down Expand Up @@ -1440,11 +1434,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
}
// Display GPS status
if (!config.position.gps_enabled) {
int16_t yPos = y + 2;
#ifdef GPS_POWER_TOGGLE
yPos = (y + 10 + FONT_HEIGHT_SMALL);
#endif
drawGPSpowerstat(display, x, yPos, gpsStatus);
drawGPSpowerstat(display, x, y + 2, gpsStatus);
} else {
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT) {
drawGPS(display, x + (SCREEN_WIDTH * 0.63), y + 2, gpsStatus);
Expand Down Expand Up @@ -1761,6 +1751,9 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat
drawGPScoordinates(display, x, y + FONT_HEIGHT_SMALL * 3, gpsStatus);
} else {
drawGPSpowerstat(display, x - (SCREEN_WIDTH / 4), y + FONT_HEIGHT_SMALL * 2, gpsStatus);
#ifdef GPS_POWER_TOGGLE
display->drawString(x + 30, (y + FONT_HEIGHT_SMALL * 3), " by button");
#endif
}
/* Display a heartbeat pixel that blinks every time the frame is redrawn */
#ifdef SHOW_REDRAWS
Expand Down

0 comments on commit 2fe5eae

Please sign in to comment.