Fixed progress reporting
This commit is contained in:
parent
afb98a2c98
commit
41625a0955
10
src/main.cpp
10
src/main.cpp
|
@ -179,8 +179,11 @@ void program_rom(std::unique_ptr<serial::Serial>& ser, std::string filename, uin
|
|||
|
||||
// Track progress
|
||||
std::cout << "Programming... (base address: 0x" << std::hex << address << std::dec << ")\n";
|
||||
for (uint16_t progress = 0; progress != length; progress = read_length<uint16_t>(ser)) {
|
||||
for (uint16_t progress = 0; ; progress = read_length<uint16_t>(ser)) {
|
||||
std::cout << "Progress: " << progress << '/' << length << '\r';
|
||||
if (progress == length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::cout << '\n';
|
||||
|
||||
|
@ -246,8 +249,11 @@ void program_i2c(std::unique_ptr<serial::Serial>& ser, std::string filename, uin
|
|||
|
||||
// Track progress
|
||||
std::cout << "Programming...\n";
|
||||
for (uint16_t progress = 0; progress != length; progress = read_length<uint16_t>(ser)) {
|
||||
for (uint16_t progress = 0; ; progress = read_length<uint16_t>(ser)) {
|
||||
std::cout << "Progress: " << progress << '/' << length << '\r';
|
||||
if (progress == length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::cout << '\n';
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user