mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
increase firmware flashing packet size
This commit is contained in:
committed by
David Lechner
parent
c3037a56e6
commit
0944a27eb9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user