From f6b308f4fb957b2ddad1b91674c21b3684ce620d Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 25 Oct 2023 16:19:10 +0000 Subject: [PATCH] fix calliopemini product id --- calliopemini.ts | 3 +++ mbcompat.ts | 2 +- microbit.ts | 3 +++ pxt.json | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 calliopemini.ts create mode 100644 microbit.ts diff --git a/calliopemini.ts b/calliopemini.ts new file mode 100644 index 000000000..d4578cf9b --- /dev/null +++ b/calliopemini.ts @@ -0,0 +1,3 @@ +namespace jacdac { + export const TARGET_PRODUCT_ID = 0x3347a2d2 +} \ No newline at end of file diff --git a/mbcompat.ts b/mbcompat.ts index a250a8ced..4d0a7bc7b 100644 --- a/mbcompat.ts +++ b/mbcompat.ts @@ -97,7 +97,7 @@ function handleStatusEvent(event: jacdac.StatusEvent) { function initPlatform() { // don't use any jacdac static - it isn't initialized here yet in sim (pxt bug) jacdac.onPlatformStart = function () { - jacdac.productIdentifier = 0x32f6253d + jacdac.productIdentifier = jacdac.TARGET_PRODUCT_ID jacdac.bus.on(jacdac.STATUS_EVENT, handleStatusEvent) if (settings.exists(jacdac.JACDAC_PROXY_SETTING)) { const reset = () => control.reset() diff --git a/microbit.ts b/microbit.ts new file mode 100644 index 000000000..8e114b30a --- /dev/null +++ b/microbit.ts @@ -0,0 +1,3 @@ +namespace jacdac { + export const TARGET_PRODUCT_ID = 0x32f6253d +} diff --git a/pxt.json b/pxt.json index 5670c3d5c..3a7870479 100644 --- a/pxt.json +++ b/pxt.json @@ -25,6 +25,8 @@ "JacdacBLE.h", "JacdacBLE.cpp", "jdble.cpp", + "microbit.ts", + "calliopemini.ts", "mbcompat.ts", "commands.ts", "config.ts", @@ -70,6 +72,8 @@ "testDependencies": {}, "fileDependencies": { "mbcompat.ts": "target:microbit || target:calliopemini", + "microbit.ts": "target:microbit", + "calliopemini.ts": "target:calliopemini", "nonmaker.ts": "!target:maker", "maker.ts": "target:maker", "test.microbit.ts": "target:microbit || target:calliopemini",