diff --git a/src/ds/d500/d500-fw-update-device.cpp b/src/ds/d500/d500-fw-update-device.cpp index ddccfecf04..7687a2e977 100644 --- a/src/ds/d500/d500-fw-update-device.cpp +++ b/src/ds/d500/d500-fw-update-device.cpp @@ -91,7 +91,7 @@ ds_d500_update_device::ds_d500_update_device( std::shared_ptr< const device_info elapsed_seconds = std::chrono::duration_cast(curr - start); if (elapsed_seconds > timeout_seconds) { - LOG_DEBUG("DFU in MANIFEST STATUS Timeout"); + LOG_ERROR("DFU in MANIFEST STATUS Timeout"); return false; } } while (percentage_of_transfer < 100 && dfu_state == RS2_DFU_STATE_DFU_MANIFEST); diff --git a/src/fw-update/fw-update-device.cpp b/src/fw-update/fw-update-device.cpp index efd7d51e47..20054b524f 100644 --- a/src/fw-update/fw-update-device.cpp +++ b/src/fw-update/fw-update-device.cpp @@ -141,6 +141,8 @@ namespace librealsense float update_device::compute_progress(float progress, float start, float end, float threshold) const { + if (threshold < 1.f && threshold > -1.f) + throw std::invalid_argument("Avoid division by zero"); return start + (ceil(progress * threshold) / threshold) * (end - start) / 100.f; } @@ -236,7 +238,7 @@ namespace librealsense LOG_DEBUG("fw update progress: " << progress); if (update_progress_callback) { - auto progress_for_bar = compute_progress(progress, 0.f, 20.f, 5.f) / 100.f;//((ceil(progress * 5) / 5) * 20.f / 100.f) / 100.f; + auto progress_for_bar = compute_progress(progress, 0.f, 20.f, 5.f) / 100.f; update_progress_callback->on_update_progress(progress_for_bar); } }