firmware/ev3: add extra progress report

Add an extra progress between erasing and writing. This makes the
progress not stall for quite as long before progressing when flashing
smaller firmwares.
This commit is contained in:
David Lechner
2026-01-24 16:16:02 -06:00
parent 055d2c8ca8
commit 38bb4f3092
+16
View File
@@ -1254,6 +1254,22 @@ function* handleFlashEV3(action: ReturnType<typeof firmwareFlashEV3>): Generator
return;
}
// Erasing takes about the same time as writing, so this will make the
// progress bar smoother.
yield* put(
alertsShowAlert(
'firmware',
'flashProgress',
{
action: 'flash',
progress:
(i + sectorData.byteLength / 2) / action.firmware.byteLength,
},
firmwareEv3ProgressToastId,
true,
),
);
for (let j = 0; j < sectorData.byteLength; j += maxPayloadSize) {
const payload = sectorData.slice(j, j + maxPayloadSize);