Skip to content
Snippets Groups Projects
Commit b8154048 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix ETA calculation.

Use remaining bytes divided by CPS rather than total estimated time
minus elapsed time.

We squirrley on resumed ZModem downloads.
parent 30921159
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2231 passed
...@@ -551,8 +551,7 @@ void zmodem_progress(void* cbdata, int64_t current_pos) ...@@ -551,8 +551,7 @@ void zmodem_progress(void* cbdata, int64_t current_pos)
zm->transfer_start_pos=0; zm->transfer_start_pos=0;
if((cps=(unsigned)((current_pos-zm->transfer_start_pos)/t))==0) if((cps=(unsigned)((current_pos-zm->transfer_start_pos)/t))==0)
cps=1; /* cps so far */ cps=1; /* cps so far */
l=zm->current_file_size/cps; /* total transfer est time */ l = (zm->current_file_size - current_pos) / cps; /* remaining transfer est time */
l-=t; /* now, it's est time left */
if(l<0) l=0; if(l<0) l=0;
cprintf("File (%u of %u): %-.*s" cprintf("File (%u of %u): %-.*s"
,zm->current_file_num, zm->total_files, TRANSFER_WIN_WIDTH - 20, zm->current_file_name); ,zm->current_file_num, zm->total_files, TRANSFER_WIN_WIDTH - 20, zm->current_file_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment