# HG changeset patch # User Mychaela Falconia # Date 1582585623 0 # Node ID 02bdb2f366bc0026b8ead323b865f4dfa46d0c45 # Parent ab4021fb1c66b52c472e9afe3fbd24948bd31577 fc-xram: added transfer time reporting diff -r ab4021fb1c66 -r 02bdb2f366bc loadtools/chainload.c --- a/loadtools/chainload.c Mon Feb 24 22:30:00 2020 +0000 +++ b/loadtools/chainload.c Mon Feb 24 23:07:03 2020 +0000 @@ -8,6 +8,7 @@ #include #include #include +#include #include "srecreader.h" struct srecreader xramimage; @@ -38,6 +39,8 @@ int resp; unsigned long rec_count; char *argv[3], srecarg[516]; + time_t start_time, finish_time; + unsigned duration, mm, ss; if (open_srec_file(&xramimage) < 0) exit(1); @@ -67,8 +70,10 @@ xramimage.record_type); exit(1); } - if (xramimage.record_type == '7') + if (xramimage.record_type == '7') { + time(&finish_time); break; + } /* must be S3 */ if (xramimage.datalen < 1) { fprintf(stderr, @@ -76,8 +81,10 @@ xramimage.filename, xramimage.lineno); exit(1); } - if (!rec_count) + if (!rec_count) { printf("Each \'.\' is 100 S-records\n"); + time(&start_time); + } make_ml_arg(xramimage.record, srecarg); tpinterf_make_cmd(argv); if (tpinterf_send_cmd()) @@ -99,6 +106,10 @@ exit(1); } putchar('\n'); /* newline after the dots */ + duration = finish_time - start_time; + mm = duration / 60; + ss = duration - mm * 60; + printf("XRAM image transferred in %um%us\n", mm, ss); if (xram_run_baudrate != current_baud_rate) { resp = loadagent_switch_baud(xram_run_baudrate); if (resp)