ui: gps: added indication for no GPS device detected

Clearly show on UI the case when no GPS receiver has been detected in the
hardware. Previously either the "GPS off" or "No fix" strings where shown
also in case of no GPS, causing ambiguity.
This commit is contained in:
Silvano Seva 2025-08-15 19:56:50 +02:00
parent 44d0774b39
commit 40ff9baa47
4 changed files with 9 additions and 3 deletions

View File

@ -94,6 +94,7 @@ const stringsTable_t englishStrings =
.broadcast = "ALL", .broadcast = "ALL",
.radioSettings = "Radio Settings", .radioSettings = "Radio Settings",
.frequencyOffset = "Frequency Offset", .frequencyOffset = "Frequency Offset",
.macroLatching = "Macro Latching" .macroLatching = "Macro Latching",
.noGps = "No GPS",
}; };
#endif // ENGLISHSTRINGS_H #endif // ENGLISHSTRINGS_H

View File

@ -95,6 +95,7 @@ const stringsTable_t spanishStrings =
.broadcast = "TODOS", .broadcast = "TODOS",
.radioSettings = "Ajustes de Radio", .radioSettings = "Ajustes de Radio",
.frequencyOffset = "Offset de frecuencia", .frequencyOffset = "Offset de frecuencia",
.macroLatching = "Macro Latching" .macroLatching = "Macro Latching",
.noGps = "Ningún GPS",
}; };
#endif // SPANISHSTRINGS_H #endif // SPANISHSTRINGS_H

View File

@ -99,6 +99,7 @@ typedef struct
const char* radioSettings; const char* radioSettings;
const char* frequencyOffset; const char* frequencyOffset;
const char* macroLatching; const char* macroLatching;
const char* noGps;
} }
stringsTable_t; stringsTable_t;

View File

@ -638,7 +638,10 @@ void _ui_drawMenuGPS()
color_white, currentLanguage->gps); color_white, currentLanguage->gps);
point_t fix_pos = {layout.line2_pos.x, CONFIG_SCREEN_HEIGHT * 2 / 5}; point_t fix_pos = {layout.line2_pos.x, CONFIG_SCREEN_HEIGHT * 2 / 5};
// Print GPS status, if no fix, hide details // Print GPS status, if no fix, hide details
if(!last_state.settings.gps_enabled) if(!last_state.gpsDetected)
gfx_print(fix_pos, layout.line3_large_font, TEXT_ALIGN_CENTER,
color_white, currentLanguage->noGps);
else if(!last_state.settings.gps_enabled)
gfx_print(fix_pos, layout.line3_large_font, TEXT_ALIGN_CENTER, gfx_print(fix_pos, layout.line3_large_font, TEXT_ALIGN_CENTER,
color_white, currentLanguage->gpsOff); color_white, currentLanguage->gpsOff);
else if (last_state.gps_data.fix_quality == 0) else if (last_state.gps_data.fix_quality == 0)