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
+12
View File
@@ -107,6 +107,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -622,6 +623,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -767,6 +769,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -861,6 +864,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -964,6 +968,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1107,6 +1112,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1236,6 +1242,7 @@ describe('flashFirmware', () => {
let action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1477,6 +1484,7 @@ describe('flashFirmware', () => {
let action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1536,6 +1544,7 @@ describe('flashFirmware', () => {
let action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1596,6 +1605,7 @@ describe('flashFirmware', () => {
let action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1659,6 +1669,7 @@ describe('flashFirmware', () => {
let action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
@@ -1759,6 +1770,7 @@ describe('flashFirmware', () => {
action = await saga.take();
expect(action).toMatchInlineSnapshot(`
Object {
"abiVersion": 5,
"options": Array [
"-mno-unicode",
],
+3 -1
View File
@@ -207,7 +207,9 @@ function* loadFirmware(
yield* disconnectAndCancel();
}
yield* put(compile(program, metadata['mpy-cross-options']));
yield* put(
compile(program, metadata['mpy-abi-version'], metadata['mpy-cross-options']),
);
const { mpy, mpyFail } = yield* race({
mpy: take(didCompile),
mpyFail: take(didFailToCompile),