mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-23 05:24:46 +00:00
Move reboot
This commit is contained in:
parent
51dc2da83c
commit
96663218ee
@ -1675,11 +1675,10 @@ bool NodeDB::restorePreferences(meshtastic_AdminMessage_BackupLocation location,
|
|||||||
}
|
}
|
||||||
|
|
||||||
success = saveToDisk(restoreWhat);
|
success = saveToDisk(restoreWhat);
|
||||||
if (!success) {
|
if (success) {
|
||||||
LOG_ERROR("Failed to save restored preferences to flash");
|
LOG_INFO("Restored preferences from backup");
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Restored preferences from backup... Rebooting");
|
LOG_ERROR("Failed to save restored preferences to flash");
|
||||||
rebootAtMsec = millis() + 1000;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERROR("Failed to restore preferences from backup file");
|
LOG_ERROR("Failed to restore preferences from backup file");
|
||||||
|
@ -387,7 +387,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
if (nodeDB->restorePreferences(r->backup_preferences,
|
if (nodeDB->restorePreferences(r->backup_preferences,
|
||||||
SEGMENT_DEVICESTATE | SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_CHANNELS)) {
|
SEGMENT_DEVICESTATE | SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_CHANNELS)) {
|
||||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||||
|
LOG_DEBUG("Rebooting after successful restore of preferences");
|
||||||
disableBluetooth();
|
disableBluetooth();
|
||||||
|
reboot(1000);
|
||||||
} else {
|
} else {
|
||||||
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
|
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user