mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-03 04:23:52 +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);
|
||||
if (!success) {
|
||||
LOG_ERROR("Failed to save restored preferences to flash");
|
||||
if (success) {
|
||||
LOG_INFO("Restored preferences from backup");
|
||||
} else {
|
||||
LOG_INFO("Restored preferences from backup... Rebooting");
|
||||
rebootAtMsec = millis() + 1000;
|
||||
LOG_ERROR("Failed to save restored preferences to flash");
|
||||
}
|
||||
} else {
|
||||
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,
|
||||
SEGMENT_DEVICESTATE | SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_CHANNELS)) {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||
LOG_DEBUG("Rebooting after successful restore of preferences");
|
||||
disableBluetooth();
|
||||
reboot(1000);
|
||||
} else {
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user