From 3c4a79c45537df2b996b8a93b7924651179dcfa9 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Wed, 27 Mar 2024 11:53:14 +0000 Subject: [PATCH 1/4] Update to latest from audio-recording branch --- lib/micropython-microbit-v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/micropython-microbit-v2 b/lib/micropython-microbit-v2 index 87f726ce..0b06914c 160000 --- a/lib/micropython-microbit-v2 +++ b/lib/micropython-microbit-v2 @@ -1 +1 @@ -Subproject commit 87f726cec9feeffcaee6e953d85fea14b28c404f +Subproject commit 0b06914c71c18533da90df85230ac198578669bf From 7aaa8001a4a070ebc4b898b46e65084ddbedb9d7 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Wed, 27 Mar 2024 13:08:07 +0000 Subject: [PATCH 2/4] Remove unused HAL method Closes https://github.com/microbit-foundation/micropython-microbit-v2-simulator/issues/101 --- src/board/display.ts | 5 ----- src/jshal.h | 1 - src/jshal.js | 4 ---- src/microbithal_js.c | 4 ---- 4 files changed, 14 deletions(-) diff --git a/src/board/display.ts b/src/board/display.ts index e2b075a9..503df381 100644 --- a/src/board/display.ts +++ b/src/board/display.ts @@ -42,11 +42,6 @@ export class Display { this.render(); } - clear() { - this.state = this.initialState(); - this.render(); - } - setPixel(x: number, y: number, value: number) { value = clamp(value, 0, 9); this.state[x][y] = value; diff --git a/src/jshal.h b/src/jshal.h index 320af1a5..c83bca65 100644 --- a/src/jshal.h +++ b/src/jshal.h @@ -56,7 +56,6 @@ int mp_js_hal_pin_set_analog_period_us(int pin, int period); int mp_js_hal_display_get_pixel(int x, int y); void mp_js_hal_display_set_pixel(int x, int y, int value); -void mp_js_hal_display_clear(void); int mp_js_hal_display_read_light_level(void); int mp_js_hal_accelerometer_get_x(void); diff --git a/src/jshal.js b/src/jshal.js index 90d6b9f3..4227557a 100644 --- a/src/jshal.js +++ b/src/jshal.js @@ -161,10 +161,6 @@ mergeInto(LibraryManager.library, { Module.board.display.setPixel(x, y, value); }, - mp_js_hal_display_clear: function () { - Module.board.display.clear(); - }, - mp_js_hal_display_read_light_level: function () { return Module.board.display.lightLevel.value; }, diff --git a/src/microbithal_js.c b/src/microbithal_js.c index a938352f..22fbfd97 100644 --- a/src/microbithal_js.c +++ b/src/microbithal_js.c @@ -318,10 +318,6 @@ void microbit_hal_display_enable(int value) { */ } -void microbit_hal_display_clear(void) { - mp_js_hal_display_clear(); -} - int microbit_hal_display_get_pixel(int x, int y) { return mp_js_hal_display_get_pixel(x, y); } From c562955891e2defa3a8adc4775c4b538e7a4a414 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Wed, 27 Mar 2024 13:20:12 +0000 Subject: [PATCH 3/4] Reinstate clear on display for non-HAL use (reset) --- src/board/display.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/board/display.ts b/src/board/display.ts index 503df381..e2b075a9 100644 --- a/src/board/display.ts +++ b/src/board/display.ts @@ -42,6 +42,11 @@ export class Display { this.render(); } + clear() { + this.state = this.initialState(); + this.render(); + } + setPixel(x: number, y: number, value: number) { value = clamp(value, 0, 9); this.state[x][y] = value; From 88e2baf1b78e753af2d111f8026dd9ce08e51aa8 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Wed, 27 Mar 2024 13:20:26 +0000 Subject: [PATCH 4/4] Safari 13 compatible speech option Needs testing but likely closes https://github.com/microbit-foundation/micropython-microbit-v2-simulator/issues/110 --- src/mpconfigport.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mpconfigport.h b/src/mpconfigport.h index a5064046..e80fac5a 100644 --- a/src/mpconfigport.h +++ b/src/mpconfigport.h @@ -87,6 +87,8 @@ #define MICROPY_PY_TIME (1) #define MICROPY_PY_MACHINE_PULSE (1) +#define MICROPY_PY_SPEECH_DEFAULT_MODE (3) + #define MICROPY_HW_ENABLE_RNG (1) // The simulator provides its own version of the relevant mbfs methods.