Add support for MPY ABI v6.

Pybricks firmware v3.2.0b2 has updated to MicroPython 1.19 which
includes breaking changes to the MPY binary file format.
This commit is contained in:
David Lechner
2022-07-06 12:51:01 -05:00
parent f06b7c0c2c
commit 90cd4865e8
15 changed files with 129 additions and 45 deletions
+1 -1
View File
@@ -20,5 +20,5 @@ it('should dispatch action when clicked', async () => {
await user.click(button.getByRole('button', { name: 'Run' }));
expect(dispatch).toHaveBeenCalledWith(downloadAndRun());
expect(dispatch).toHaveBeenCalledWith(downloadAndRun(6));
});
+2 -1
View File
@@ -14,6 +14,7 @@ type RunButtonProps = Pick<ActionButtonProps, 'id'>;
const RunButton: React.VoidFunctionComponent<RunButtonProps> = ({ id }) => {
const downloadProgress = useSelector((s) => s.hub.downloadProgress);
const mpyAbiVersion = useSelector((s) => s.hub.mpyAbiVersion);
const runtime = useSelector((s) => s.hub.runtime);
const isEditorReady = useSelector((s) => s.editor.isReady);
const keyboardShortcut = 'F5';
@@ -37,7 +38,7 @@ const RunButton: React.VoidFunctionComponent<RunButtonProps> = ({ id }) => {
enabled={isEditorReady && runtime === HubRuntimeState.Idle}
showProgress={runtime === HubRuntimeState.Loading}
progress={downloadProgress === null ? undefined : downloadProgress}
onAction={() => dispatch(downloadAndRun())}
onAction={() => dispatch(downloadAndRun(mpyAbiVersion))}
/>
);
};