mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
wire up firmware flash progress
Also turn off logging and longer checksum interval to improve performance 94K movehub fw flashes in about 1:45
This commit is contained in:
committed by
David Lechner
parent
7ba99d62bb
commit
3ae2fb2eef
@@ -299,6 +299,10 @@ export enum BootloaderActionType {
|
||||
* Flash new firmware to the device.
|
||||
*/
|
||||
FlashFirmware = 'bootloader.action.flash',
|
||||
/**
|
||||
* Firmware flash progress.
|
||||
*/
|
||||
FlashProgress = 'bootloader.action.flash.progress',
|
||||
}
|
||||
|
||||
export interface BootloaderFlashFirmwareAction
|
||||
@@ -309,3 +313,26 @@ export interface BootloaderFlashFirmwareAction
|
||||
export function flashFirmware(data: ArrayBuffer): BootloaderFlashFirmwareAction {
|
||||
return { type: BootloaderActionType.FlashFirmware, data };
|
||||
}
|
||||
|
||||
export interface BootloaderFlashProgressAction
|
||||
extends Action<BootloaderActionType.FlashProgress> {
|
||||
/**
|
||||
* The number of bytes that have been flashed so far.
|
||||
*/
|
||||
complete: number;
|
||||
/**
|
||||
* The total number of bytes to be flashed.
|
||||
*/
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function progress(
|
||||
complete: number,
|
||||
total: number,
|
||||
): BootloaderFlashProgressAction {
|
||||
return { type: BootloaderActionType.FlashProgress, complete, total };
|
||||
}
|
||||
|
||||
export type BootloaderAction =
|
||||
| BootloaderFlashFirmwareAction
|
||||
| BootloaderFlashProgressAction;
|
||||
|
||||
Reference in New Issue
Block a user