Only show one 'Loading' and one 'Verifying' progress bar when loading#130
Only show one 'Loading' and one 'Verifying' progress bar when loading#130DavidEGrayson wants to merge 1 commit intoraspberrypi:developfrom
Conversation
This makes the output much shorter and more useful when loading a UF2 file that writes to many different memory ranges, which can happen if it contains a filesystem. Also, don't bother printing "OK": if the verification finished that means everything was OK.
| for (auto r : ranges) { total_bytes += r.to - r.from; } | ||
| { |
There was a problem hiding this comment.
It's probably worth keeping the // new scope for progress bar comment, oherwise it might look like the { on the second line is associated with the for on the previous line 😉
Or alternatively, as there's now not multiple progress bars, perhaps this additional scope is no longer necessary? 🤔
will-v-pi
left a comment
There was a problem hiding this comment.
I'm happy with the general idea of this change, but I would want to keep the "OK" printout after verifying for clarity, and keep the "Loading into xxx" printout to specify whether it's loading into flash or SRAM. Therefore it will still need to split the memory ranges into different memory types, with a separate loading bar for each memory type - possibly by having get_coalesced_ranges return a vector<vector<range>> with a separate vector<range> for each memory type?
These changes should also be made to the verify command and the verify section of the save command, as those have similar progress bars.
This makes the output much shorter and more useful when loading a UF2 file that writes to many different memory ranges, which can happen if it contains a filesystem. Also, this PR removes the "OK" message that was printed after verification: if the verification finished and there is no error message, that means everything was OK.
This is similar to what I did in my older pull request #66 from 18 months ago for picotool version 1, but that pull request had a bigger scope and was never merged in.
If you want to test this, here is a simple Ruby script I used to generate a fragmented UF2 file for a Pico 2:
Picotool output before this pull request:
Picotool output after this pull request: