From 5d879f7e04cac182e5f3854dc9a15a729c046225 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Tue, 15 Nov 2022 11:03:13 +0000 Subject: [PATCH 1/3] micro:bit MicroPython 2.1.1 - Match fix for pin 11. - Update port config to match. --- lib/micropython-microbit-v2 | 2 +- src/board/constants.ts | 2 +- src/mpconfigport.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/micropython-microbit-v2 b/lib/micropython-microbit-v2 index e4321a86..8aaa36b8 160000 --- a/lib/micropython-microbit-v2 +++ b/lib/micropython-microbit-v2 @@ -1 +1 @@ -Subproject commit e4321a866e3f8ef48a7f5b5e96db99cc39b09757 +Subproject commit 8aaa36b8d50211f5902d50e050632a88358d369f diff --git a/src/board/constants.ts b/src/board/constants.ts index 3c7e3bee..39a6ab9e 100644 --- a/src/board/constants.ts +++ b/src/board/constants.ts @@ -17,7 +17,7 @@ export const MICROBIT_HAL_PIN_P7 = 7; export const MICROBIT_HAL_PIN_P8 = 8; export const MICROBIT_HAL_PIN_P9 = 9; export const MICROBIT_HAL_PIN_P10 = 10; -export const MICROBIT_HAL_PIN_P11 = 12; +export const MICROBIT_HAL_PIN_P11 = 11 export const MICROBIT_HAL_PIN_P12 = 12; export const MICROBIT_HAL_PIN_P13 = 13; export const MICROBIT_HAL_PIN_P14 = 14; diff --git a/src/mpconfigport.h b/src/mpconfigport.h index 852e2685..96592812 100644 --- a/src/mpconfigport.h +++ b/src/mpconfigport.h @@ -68,7 +68,9 @@ #define MICROPY_ENABLE_SCHEDULER (1) // Fine control over Python builtins, classes, modules, etc +#define MICROPY_PY_BUILTINS_STR_UNICODE (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) +#define MICROPY_PY_BUILTINS_FROZENSET (1) #define MICROPY_PY_BUILTINS_INPUT (1) #define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_TEXT microbit_help_text @@ -100,7 +102,7 @@ { MP_ROM_QSTR(MP_QSTR_open), MP_ROM_PTR(&mp_builtin_open_obj) }, #endif -#define MICROBIT_RELEASE "2.1.0" +#define MICROBIT_RELEASE "2.1.1" #define MICROBIT_BOARD_NAME "micro:bit" #define MICROPY_HW_BOARD_NAME MICROBIT_BOARD_NAME " v" MICROBIT_RELEASE #define MICROPY_HW_MCU_NAME "nRF52833" From 3357ce2a2539f7465d1762c8f0eb23b7b5214f23 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Tue, 15 Nov 2022 11:13:19 +0000 Subject: [PATCH 2/3] Fix example for final API. --- src/examples/sound_effects_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/examples/sound_effects_user.py b/src/examples/sound_effects_user.py index 9ba7595f..60895943 100644 --- a/src/examples/sound_effects_user.py +++ b/src/examples/sound_effects_user.py @@ -8,7 +8,7 @@ duration=500, vol_start=100, vol_end=255, - wave=audio.SoundEffect.WAVEFORM_TRIANGLE, + waveform=audio.SoundEffect.WAVEFORM_TRIANGLE, fx=audio.SoundEffect.FX_VIBRATO, shape=audio.SoundEffect.SHAPE_LOG, ) From 19afbf0f04f773979a0c2350fd08f6dfb5b1d670 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon <44397098+microbit-matt-hillsdon@users.noreply.github.com> Date: Tue, 15 Nov 2022 12:50:07 +0000 Subject: [PATCH 3/3] Install a fixed build of emscripten. (#96) We've not seen issues using latest but it's likely to break us eventually. Closes https://github.com/microbit-foundation/micropython-microbit-v2-simulator/issues/15 --- ci-build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci-build.sh b/ci-build.sh index 14c311ce..47b0ac72 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -6,10 +6,11 @@ git submodule update --init lib/micropython-microbit-v2 (cd lib/micropython-microbit-v2 && git submodule update --init lib/micropython) # Emscripten +VERSION="3.1.25" export PYTHON=python3.7 # Needed by Emscripten in Netlify's build image. -git clone https://github.com/emscripten-core/emsdk.git ~/.emsdk -~/.emsdk/emsdk install latest -~/.emsdk/emsdk activate latest +git clone https://github.com/emscripten-core/emsdk.git -b $VERSION ~/.emsdk +~/.emsdk/emsdk install $VERSION +~/.emsdk/emsdk activate $VERSION source ~/.emsdk/emsdk_env.sh npm run test && npm run build