diff --git a/README.md b/README.md index 25c71863..a57e1edc 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,7 @@ Some extra details: VmaxBatt custom VminBatt custom tempOffs custom + defGMT custom ``` **kset KEYNAME**: Set user custom settings: diff --git a/lib/gps/timezone.hpp b/lib/gps/timezone.hpp index 2b9a6709..a380b818 100644 --- a/lib/gps/timezone.hpp +++ b/lib/gps/timezone.hpp @@ -9,14 +9,7 @@ #ifndef TIMEZONE_HPP #define TIMEZONE_HPP -// Set these values to the offset of your timezone from GMT - -static const int32_t zone_hours = 1L; -static const int32_t zone_minutes = 0L; // usually zero -static const NeoGPS::clock_t zone_offset = - zone_hours * NeoGPS::SECONDS_PER_HOUR + - zone_minutes * NeoGPS::SECONDS_PER_MINUTE; - +extern int32_t defGMT; // Default GMT offset // Uncomment one DST changeover rule, or define your own: @@ -51,6 +44,11 @@ static void adjustTime( NeoGPS::time_t & dt ) { NeoGPS::clock_t seconds = dt; // convert date/time structure to seconds + // Set these values to the offset of your timezone from GMT + static const int32_t zone_minutes = 0L; // usually zero + static const NeoGPS::clock_t zone_offset = (int32_t)defGMT * NeoGPS::SECONDS_PER_HOUR + + zone_minutes * NeoGPS::SECONDS_PER_MINUTE; + #ifdef CALCULATE_DST // Calculate DST changeover times once per reset and year! static NeoGPS::time_t changeover; diff --git a/lib/preferences/preferences-keys.h b/lib/preferences/preferences-keys.h index 88d13d00..09a1d110 100644 --- a/lib/preferences/preferences-keys.h +++ b/lib/preferences/preferences-keys.h @@ -29,4 +29,5 @@ X(KVMAX_BATT, "VmaxBatt", FLOAT) \ X(KVMIN_BATT, "VminBatt", FLOAT) \ X(KTEMP_OFFS, "tempOffs", INT) \ + X(KGMT_OFFS, "defGMT", INT) \ X(KCOUNT, "KCOUNT", UNKNOWN) diff --git a/lib/settings/settings.cpp b/lib/settings/settings.cpp index 2adfeea2..7a797369 100644 --- a/lib/settings/settings.cpp +++ b/lib/settings/settings.cpp @@ -31,6 +31,7 @@ uint8_t zoom = 0; // Actual Zoom Level bool isMapRotation = true; // Map Compass Rotation uint8_t defaultZoom = 0; // Default Zoom Value uint8_t defBright = 255; // Default Brightness +int32_t defGMT = 1; // Default GMT offset bool showMapCompass = true; // Compass in map screen bool isCompassRot = true; // Compass rotation in map screen bool showMapSpeed = true; // Speed in map screen @@ -81,6 +82,7 @@ void loadPreferences() speedPosY = cfg.getInt(PKEYS::KSPEED_Y, TFT_HEIGHT - 130); isVectorMap = cfg.getBool(PKEYS::KMAP_VECTOR, false); defBright = cfg.getUInt(PKEYS::KDEF_BRIGT, 254); + defGMT = cfg.getInt(PKEYS::KGMT_OFFS, 1); if (isVectorMap) { minZoom = 1;