Merge branch 'master' into tft-gui-work

This commit is contained in:
Manuel 2024-05-31 15:48:55 +02:00 committed by GitHub
commit 7904f079a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 10 deletions

@ -1 +1 @@
Subproject commit 9e61b8233181715363aba2aa6c91e85a2d61fc73 Subproject commit a45a6154d0721027bf63f85cfc5abd9f6fab2422

View File

@ -222,9 +222,8 @@ bool perhapsSetRTC(RTCQuality q, struct tm &t)
*/ */
int32_t getTZOffset() int32_t getTZOffset()
{ {
time_t now; time_t now = getTime(false);
struct tm *gmt; struct tm *gmt;
now = time(NULL);
gmt = gmtime(&now); gmt = gmtime(&now);
gmt->tm_isdst = -1; gmt->tm_isdst = -1;
return (int32_t)difftime(now, mktime(gmt)); return (int32_t)difftime(now, mktime(gmt));
@ -265,4 +264,4 @@ time_t gm_mktime(struct tm *tm)
setenv("TZ", "UTC0", 1); setenv("TZ", "UTC0", 1);
} }
return res; return res;
} }

View File

@ -57,7 +57,9 @@ typedef enum _meshtastic_TelemetrySensorType {
/* Lite On LTR-390UV-01 UV Light Sensor */ /* Lite On LTR-390UV-01 UV Light Sensor */
meshtastic_TelemetrySensorType_LTR390UV = 21, meshtastic_TelemetrySensorType_LTR390UV = 21,
/* AMS TSL25911FN RGB Light Sensor */ /* AMS TSL25911FN RGB Light Sensor */
meshtastic_TelemetrySensorType_TSL25911FN = 22 meshtastic_TelemetrySensorType_TSL25911FN = 22,
/* AHT10 Integrated temperature and humidity sensor */
meshtastic_TelemetrySensorType_AHT10 = 23
} meshtastic_TelemetrySensorType; } meshtastic_TelemetrySensorType;
/* Struct definitions */ /* Struct definitions */
@ -168,8 +170,8 @@ extern "C" {
/* Helper constants for enums */ /* Helper constants for enums */
#define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET
#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_TSL25911FN #define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_AHT10
#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_TSL25911FN+1)) #define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_AHT10+1))

View File

@ -211,11 +211,11 @@ meshtastic_MeshPacket *PositionModule::allocReply()
// Strip out any time information before sending packets to other nodes - to keep the wire size small (and because other // Strip out any time information before sending packets to other nodes - to keep the wire size small (and because other
// nodes shouldn't trust it anyways) Note: we allow a device with a local GPS to include the time, so that gpsless // nodes shouldn't trust it anyways) Note: we allow a device with a local GPS to include the time, so that gpsless
// devices can get time. // devices can get time.
if (getRTCQuality() < RTCQualityDevice) { if (getRTCQuality() < RTCQualityGPS) {
LOG_INFO("Stripping time %u from position send\n", p.time); LOG_INFO("Stripping time %u from position send\n", p.time);
p.time = 0; p.time = 0;
} else { } else {
p.time = getValidTime(RTCQualityDevice); p.time = getValidTime(RTCQualityGPS);
LOG_INFO("Providing time to mesh %u\n", p.time); LOG_INFO("Providing time to mesh %u\n", p.time);
} }
@ -454,4 +454,4 @@ void PositionModule::handleNewPosition()
} }
} }
#endif #endif