refactor: more conditionals for GPS

also re-added some missing returns.
This commit is contained in:
taco
2025-05-23 18:58:45 +10:00
parent 400c4353dc
commit 5987e95ce9
3 changed files with 19 additions and 6 deletions
@@ -127,14 +127,16 @@ bool EnvironmentSensorManager::querySensors(uint8_t requester_permissions, Cayen
int EnvironmentSensorManager::getNumSettings() const {
#if ENV_INCLUDE_GPS
return gps_detected ? 1 : 0; // only show GPS setting if GPS is detected
return gps_detected ? 1 : 0; // only show GPS setting if GPS is detected
#endif
return NULL;
}
const char* EnvironmentSensorManager::getSettingName(int i) const {
#if ENV_INCLUDE_GPS
return (gps_detected && i == 0) ? "gps" : NULL;
return (gps_detected && i == 0) ? "gps" : NULL;
#endif
return NULL;
}
const char* EnvironmentSensorManager::getSettingValue(int i) const {