firmware: flash custom hub name

This adds support for customizing the hub name when flashing firmware.

Fixes: https://github.com/pybricks/support/issues/52
This commit is contained in:
David Lechner
2021-11-19 20:48:06 -06:00
parent 86c0e933f3
commit ae40c2f540
3 changed files with 25 additions and 3 deletions
+4 -2
View File
@@ -63,6 +63,8 @@ describe('flashFirmware', () => {
'mpy-abi-version': 5,
'mpy-cross-options': ['-mno-unicode'],
'user-mpy-offset': 100,
'hub-name-offset': 90,
'max-hub-name-size': 10,
};
const zip = new JSZip();
@@ -79,7 +81,7 @@ describe('flashFirmware', () => {
flashFirmware,
{
bootloader: { connection: BootloaderConnectionState.Disconnected },
settings: { flashCurrentProgram: false },
settings: { flashCurrentProgram: false, hubName: 'test name' },
},
{
nextMessageId: createCountFunc(),
@@ -185,7 +187,7 @@ describe('flashFirmware', () => {
// hub indicates success
saga.put(programResponse(0x62, totalFirmwareSize));
saga.put(programResponse(0x33, totalFirmwareSize));
action = await saga.take();
expect(action).toEqual(didProgress(1));