mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 02:06:11 +00:00
fix(companion): prompt to enable GPS when starting a trail with GPS off
Starting trail recording with GPS switched off used to call setActive(true) immediately -- the session timer ran while the screen sat on "Waiting for GPS fix" forever and recorded nothing, with no hint that GPS was the problem. Choosing "Start tracking" now opens a "GPS is off" confirmation (Enable GPS & start / Cancel); confirming enables GPS and starts the session. Behaviour is unchanged when GPS is already on. Gated on a new UITask::hasGPS() so the prompt only appears on boards that expose a toggleable GPS, not where GPS is simply absent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ab4cd09edc
commit
5d71fde980
@@ -2616,6 +2616,16 @@ bool UITask::getGPSState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UITask::hasGPS() {
|
||||
if (_sensors != NULL) {
|
||||
int num = _sensors->getNumSettings();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (strcmp(_sensors->getSettingName(i), "gps") == 0) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void UITask::toggleGPS() {
|
||||
if (_sensors != NULL) {
|
||||
// toggle GPS on/off
|
||||
|
||||
Reference in New Issue
Block a user