Update SystemCommandsModule.cpp

Removed GPS checking
This commit is contained in:
Paxy 2025-07-24 18:34:07 +02:00 committed by GitHub
parent f31c058f5f
commit 031aec6ae4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,23 +76,18 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event)
return 0; return 0;
case INPUT_BROKER_LOST_TOGGLE: case INPUT_BROKER_LOST_TOGGLE:
LOG_WARN("Lost Toggle"); LOG_WARN("Lost Toggle");
#if !MESHTASTIC_EXCLUDE_GPS if (config.device.role == meshtastic_Config_DeviceConfig_Role_CLIENT) {
if (gps) { LOG_WARN("Changing mode to LOST_AND_FOUND");
LOG_WARN("GPS present"); config.device.role = meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND;
if (config.device.role == meshtastic_Config_DeviceConfig_Role_CLIENT) { IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner("Switching to LOST!", 3000);)
LOG_WARN("Changing mode to LOST_AND_FOUND"); nodeDB->saveToDisk(SEGMENT_CONFIG);
config.device.role = meshtastic_Config_DeviceConfig_Role_LOST_AND_FOUND; } else {
IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner("Switching to LOST!", 3000);) LOG_WARN("Changing mode to Client");
nodeDB->saveToDisk(SEGMENT_CONFIG); config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT;
} else { IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner("Switching to Client!", 3000);)
LOG_WARN("Changing mode to Client"); nodeDB->saveToDisk(SEGMENT_CONFIG);
config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT; }
IF_SCREEN(screen->forceDisplay(); screen->showSimpleBanner("Switching to Client!", 3000);) rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
nodeDB->saveToDisk(SEGMENT_CONFIG);
}
rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000;
}
#endif
return true; return true;
case INPUT_BROKER_MSG_REBOOT: case INPUT_BROKER_MSG_REBOOT:
IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0)); IF_SCREEN(screen->showSimpleBanner("Rebooting...", 0));