mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-11 07:32:14 +00:00
write firmware version and hardware platform to Flash memory
This commit is contained in:
parent
f37276d5fc
commit
b3343303a9
@ -120,17 +120,24 @@ void esp32Setup()
|
|||||||
uint32_t rebootCounter = preferences.getUInt("rebootCounter", 0);
|
uint32_t rebootCounter = preferences.getUInt("rebootCounter", 0);
|
||||||
rebootCounter++;
|
rebootCounter++;
|
||||||
preferences.putUInt("rebootCounter", rebootCounter);
|
preferences.putUInt("rebootCounter", rebootCounter);
|
||||||
|
// store firmware version and hwrevision for access from OTA firmware
|
||||||
|
String fwrev = preferences.getString("firmwareVersion", "");
|
||||||
|
if (fwrev.compareTo(optstr(APP_VERSION)) != 0)
|
||||||
|
preferences.putString("firmwareVersion", optstr(APP_VERSION));
|
||||||
|
uint8_t hwven = preferences.getUInt("hwVendor", 0);
|
||||||
|
if (hwven != HW_VENDOR)
|
||||||
|
preferences.putUInt("hwVendor", HW_VENDOR);
|
||||||
preferences.end();
|
preferences.end();
|
||||||
LOG_DEBUG("Number of Device Reboots: %d\n", rebootCounter);
|
LOG_DEBUG("Number of Device Reboots: %d\n", rebootCounter);
|
||||||
#if !MESHTASTIC_EXCLUDE_BLUETOOTH
|
#if !MESHTASTIC_EXCLUDE_BLUETOOTH
|
||||||
String BLEOTA = BleOta::getOtaAppVersion();
|
String BLEOTA = BleOta::getOtaAppVersion();
|
||||||
if (BLEOTA.isEmpty()) {
|
if (BLEOTA.isEmpty()) {
|
||||||
LOG_DEBUG("No OTA firmware available\n");
|
LOG_INFO("No OTA firmware available\n");
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("OTA firmware version %s\n", BLEOTA.c_str());
|
LOG_INFO("OTA firmware version %s\n", BLEOTA.c_str());
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LOG_DEBUG("No OTA firmware available\n");
|
LOG_INFO("No OTA firmware available\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// enableModemSleep();
|
// enableModemSleep();
|
||||||
|
Loading…
Reference in New Issue
Block a user