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:
David Lechner
2020-05-20 19:57:23 -05:00
committed by David Lechner
parent 7ba99d62bb
commit 3ae2fb2eef
8 changed files with 81 additions and 39 deletions
+27
View File
@@ -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;