mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-29 18:05:42 +00:00
Factory reset RTC
This commit is contained in:
parent
55fc4fcd90
commit
225c47ede3
@ -1539,6 +1539,13 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
|
||||
if (perhapsSetRTC(RTCQualityGPS, t) == RTCSetResultInvalidTime) {
|
||||
// Clear the GPS buffer if we got an invalid time
|
||||
clearBuffer();
|
||||
// Clear the RTC from the L76K, L76B, and clones
|
||||
if (IS_ONE_OF(gnssModel, GNSS_MODEL_MTK_L76B, GNSS_MODEL_MTK)) {
|
||||
// Clear the RTC from the L76 and MTK GPS modules
|
||||
LOG_DEBUG("Clearing RTC from L76K/L76B");
|
||||
int msglen = makeCASPacket(0x06, 0x02, sizeof(_message_CAS_CFG_RST_FACTORY), _message_CAS_CFG_RST_FACTORY);
|
||||
_serial_gps->write(_message_CAS_CFG_RST_FACTORY, msglen);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
|
@ -27,6 +27,13 @@ static const uint8_t _message_CAS_CFG_RST_FACTORY[] = {
|
||||
0x03 // Startup Mode: Factory
|
||||
};
|
||||
|
||||
// Clear RTC data
|
||||
static const uint8_t _message_CAS_CFG_RST_RTC[] = {
|
||||
0x00, 0x01, // NavBbrMask: Clear RTC data
|
||||
0x01, // Reset Mode: Controlled Software reset
|
||||
0x00 // Reserved
|
||||
};
|
||||
|
||||
// CFG_RATE (0x06, 0x01)
|
||||
// 1HZ update rate, this should always be the case after
|
||||
// factory reset but update it regardless
|
||||
|
Loading…
Reference in New Issue
Block a user