ui_task: let user choose if enter in gps screen toggles or triggers gps
This commit is contained in:
1 parent
6b34ae96df
commit
b2e46335e5
5 files changed
+43
-1
No files matched your search
@@ -632,7 +632,7 @@ public:
|
||||
}
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
if (c == KEY_ENTER && _page == HomePage::GPS) {
|
||||
_task->toggleGPS();
|
||||
if (_node_prefs->ui_gps_action == 1) _task->triggerGPS(); else _task->toggleGPS();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -1232,6 +1232,15 @@ void UITask::toggleGPS() {
|
||||
}
|
||||
}
|
||||
|
||||
void UITask::triggerGPS() {
|
||||
LocationProvider* location = _sensors != NULL ? _sensors->getLocationProvider() : NULL;
|
||||
if (location != NULL && !(location->hasHardwareEnableState() && !location->isHardwareEnabled())
|
||||
&& location->startOnce()) {
|
||||
notify(UIEventType::ack);
|
||||
}
|
||||
_next_refresh = 0;
|
||||
}
|
||||
|
||||
void UITask::toggleBuzzer() {
|
||||
// Toggle buzzer quiet mode
|
||||
#ifdef PIN_BUZZER
|
||||
|
||||
Reference in new issue
Block a user