changed ms to sec

This commit is contained in:
csrutil
2025-11-29 19:02:00 +08:00
parent 39503ad0b4
commit 62e180dc0f
2 changed files with 4 additions and 4 deletions

View File

@@ -524,9 +524,9 @@ bool EnvironmentSensorManager::setSettingValue(const char* name, const char* val
if (strcmp(name, "gps_interval") == 0) { if (strcmp(name, "gps_interval") == 0) {
uint32_t interval_seconds = atoi(value); uint32_t interval_seconds = atoi(value);
if (interval_seconds > 0) { if (interval_seconds > 0) {
gps_update_interval_ms = interval_seconds * 1000; gps_update_interval_sec = interval_seconds;
} else { } else {
gps_update_interval_ms = 1000; // Default to 1 second if 0 gps_update_interval_sec = 1; // Default to 1 second if 0
} }
return true; return true;
} }
@@ -717,7 +717,7 @@ void EnvironmentSensorManager::loop() {
} }
#endif #endif
} }
next_gps_update = millis() + gps_update_interval_ms; next_gps_update = millis() + gps_update_interval_sec;
} }
#endif #endif
} }

View File

@@ -25,7 +25,7 @@ protected:
bool gps_detected = false; bool gps_detected = false;
bool gps_active = false; bool gps_active = false;
uint32_t gps_update_interval_ms = 1000; // Default 1 second uint32_t gps_update_interval_sec = 1; // Default 1 second
#if ENV_INCLUDE_GPS #if ENV_INCLUDE_GPS
LocationProvider* _location; LocationProvider* _location;