increase firmware flashing packet size

This commit is contained in:
David Lechner
2020-07-02 21:37:00 -05:00
committed by David Lechner
parent c3037a56e6
commit 0944a27eb9
2 changed files with 19 additions and 4 deletions
+7 -2
View File
@@ -303,9 +303,14 @@ function* flashFirmware(action: FlashFirmwareFlashAction): Generator {
}
let count = 0;
const maxDataSize = MaxProgramFlashSize.get(info[0].hubType);
if (maxDataSize === undefined) {
// istanbul ignore next: indicates programmer error if reached
throw Error('Missing hub type in MaxProgramFlashSize');
}
for (let offset = 0; offset < firmware.length; offset += MaxProgramFlashSize) {
const payload = firmware.slice(offset, offset + MaxProgramFlashSize);
for (let offset = 0; offset < firmware.length; offset += maxDataSize) {
const payload = firmware.slice(offset, offset + maxDataSize);
const programAction = (yield put(
programRequest(info[0].startAddress + offset, payload.buffer),
)) as BootloaderProgramRequestAction;