mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user