@@ -563,6 +563,7 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta
563563 display->setTextAlignment (TEXT_ALIGN_LEFT);
564564 display->setFont (FONT_SMALL);
565565 int line = 1 ;
566+ meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode (nodeDB->getNodeNum ());
566567
567568 // === Header ===
568569#if defined(M5STACK_UNITC6L)
@@ -740,7 +741,6 @@ void UIRenderer::drawDeviceFocused(OLEDDisplay *display, OLEDDisplayUiState *sta
740741 int yOffset = (isHighResolution) ? 0 : 5 ;
741742 std::string longNameStr;
742743
743- meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode (nodeDB->getNodeNum ());
744744 if (ourNode && ourNode->has_user && strlen (ourNode->user .long_name ) > 0 ) {
745745 longNameStr = sanitizeString (ourNode->user .long_name );
746746 }
@@ -1000,24 +1000,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
10001000 const char *displayLine = " " ; // Initialize to empty string by default
10011001 meshtastic_NodeInfoLite *ourNode = nodeDB->getMeshNode (nodeDB->getNodeNum ());
10021002
1003- bool usePhoneGPS = (ourNode && nodeDB->hasValidPosition (ourNode) &&
1004- config.position .gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED);
1005-
1006- if (usePhoneGPS) {
1007- // Phone-provided GPS is active
1008- displayLine = " Phone GPS" ;
1009- int yOffset = (isHighResolution) ? 3 : 1 ;
1010- if (isHighResolution) {
1011- NodeListRenderer::drawScaledXBitmap16x16 (x, getTextPositions (display)[line] + yOffset - 5 , imgSatellite_width,
1012- imgSatellite_height, imgSatellite, display);
1013- } else {
1014- display->drawXbm (x + 1 , getTextPositions (display)[line] + yOffset, imgSatellite_width, imgSatellite_height,
1015- imgSatellite);
1016- }
1017- int xOffset = (isHighResolution) ? 6 : 0 ;
1018- display->drawString (x + 11 + xOffset, getTextPositions (display)[line++], displayLine);
1019- } else if (config.position .gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) {
1020- // GPS disabled / not present
1003+ if (config.position .gps_mode != meshtastic_Config_PositionConfig_GpsMode_ENABLED) {
10211004 if (config.position .fixed_position ) {
10221005 displayLine = " Fixed GPS" ;
10231006 } else {
@@ -1108,9 +1091,7 @@ void UIRenderer::drawCompassAndLocationScreen(OLEDDisplay *display, OLEDDisplayU
11081091
11091092 // === Final Row: Altitude ===
11101093 char altitudeLine[32 ] = {0 };
1111- int32_t alt = (strcmp (displayLine, " Phone GPS" ) == 0 && ourNode && nodeDB->hasValidPosition (ourNode))
1112- ? ourNode->position .altitude
1113- : geoCoord.getAltitude ();
1094+ int32_t alt = geoCoord.getAltitude ();
11141095 if (config.display .units == meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL) {
11151096 snprintf (altitudeLine, sizeof (altitudeLine), " Alt: %.0fft" , alt * METERS_TO_FEET);
11161097 } else {
0 commit comments