From 38bb4f3092a0aa44b4c1cf9eab7b5ab675bd1581 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sun, 4 Jan 2026 21:16:45 +0000 Subject: [PATCH] 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. --- src/firmware/sagas.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/firmware/sagas.ts b/src/firmware/sagas.ts index 32fcc348..8935569d 100644 --- a/src/firmware/sagas.ts +++ b/src/firmware/sagas.ts @@ -1254,6 +1254,22 @@ function* handleFlashEV3(action: ReturnType): 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);