Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundled firmware update no longer fail if backup step fail #7241

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,30 @@ namespace rs2
{
log("Backing-up camera flash memory");

auto flash = upd.create_flash_backup([&](const float progress)
std::string log_backup_status;
try
{
_progress = int((ceil(progress * 5) / 5) * (30 - next_progress)) + next_progress;
});
auto flash = upd.create_flash_backup([&](const float progress)
{
_progress = int((ceil(progress * 5) / 5) * (30 - next_progress)) + next_progress;
});

auto temp = get_folder_path(special_folder::app_data);
temp += serial + "." + get_timestamped_file_name() + ".bin";

auto temp = get_folder_path(special_folder::app_data);
temp += serial + "." + get_timestamped_file_name() + ".bin";
{
std::ofstream file(temp.c_str(), std::ios::binary);
file.write((const char*)flash.data(), flash.size());
log_backup_status = "Backup completed and saved as '" + temp + "'";

}
}
catch (...)
maloel marked this conversation as resolved.
Show resolved Hide resolved
{
std::ofstream file(temp.c_str(), std::ios::binary);
file.write((const char*)flash.data(), flash.size());
log_backup_status = "Warning! - Backup step encountered an issue, continue update without it.";
maloel marked this conversation as resolved.
Show resolved Hide resolved
}

std::string log_line = "Backup completed and saved as '";
log_line += temp + "'";
log(log_line);
log(log_backup_status);

next_progress = 40;

Expand Down