From cef1f57e30e75ceb54610db1eb06d7cc3637431d Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 26 Apr 2016 17:09:15 -0700 Subject: [PATCH 1/7] expose device serial number in javascript --- libs/microbit/control.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/microbit/control.cpp b/libs/microbit/control.cpp index 7556c3ae..2d8cc1f5 100644 --- a/libs/microbit/control.cpp +++ b/libs/microbit/control.cpp @@ -163,4 +163,12 @@ namespace control { StringData* deviceName() { return ManagedString(microbit_friendly_name()).leakData(); } + + /** + * Derive a unique, consistent serial number of this device from internal data. + */ + //% + int deviceSerialNumber() { + return microbit_serial_number(); + } } From ac942e198ad34f5bf912f91f0d053b62bcd115e4 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 26 Apr 2016 17:09:27 -0700 Subject: [PATCH 2/7] missed file in previous checkin --- libs/microbit/shims.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/microbit/shims.d.ts b/libs/microbit/shims.d.ts index bf33e2be..84c4ff0d 100644 --- a/libs/microbit/shims.d.ts +++ b/libs/microbit/shims.d.ts @@ -348,6 +348,12 @@ declare namespace control { */ //% blockId="control_device_name" block="device name" weight=10 shim=control::deviceName function deviceName(): string; + + /** + * Derive a unique, consistent serial number of this device from internal data. + */ + //% shim=control::deviceSerialNumber + function deviceSerialNumber(): number; } From b30a0ced87ce6e9142ca0f5b37310737d8065526 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 26 Apr 2016 17:13:19 -0700 Subject: [PATCH 3/7] removing references to missing files --- docs/device/crocodile-clips.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/device/crocodile-clips.md b/docs/device/crocodile-clips.md index 01196b32..780acae0 100644 --- a/docs/device/crocodile-clips.md +++ b/docs/device/crocodile-clips.md @@ -11,9 +11,7 @@ This example displays a random number every time the crocodile clip holds `GND` ### Connecting Crocodile Clips -![](/static/mb/crocodile-clips-1.jpg) -![](/static/mb/crocodile-clips-2.jpg) ### Lessons From 6c539fb04f59de1a1bffe03075cd1616faddeede Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Wed, 27 Apr 2016 19:26:55 +0100 Subject: [PATCH 4/7] Add some debugger hooks --- libs/microbit/core.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index 5179f490..b74c3cc5 100644 --- a/libs/microbit/core.cpp +++ b/libs/microbit/core.cpp @@ -301,4 +301,18 @@ namespace pxtrt { { microbit_panic(code); } + + // + // Debugger + // + + //% + uint32_t getNumGlobals() { + return numGlobals; + } + + //% + void* getGlobalsPtr() { + return globals; + } } From 5565bb7d24bbfa5d35bad99bcb2aca5d14e3b20a Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 27 Apr 2016 13:13:03 -0700 Subject: [PATCH 5/7] updated target definition --- pxtarget.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pxtarget.json b/pxtarget.json index 949ac2d2..e1dff78d 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -57,7 +57,10 @@ "deployDrives": "^MICROBIT" }, "runtime": { - "mathBlocks": true + "mathBlocks": true, + "loopBlocks": true, + "logicBlocks": true, + "variablesBlocks": true }, "simulator": { "autoRun": true From 458b4553d272851d4cbaf3e6e3d4fe9e078921bb Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 27 Apr 2016 13:38:05 -0700 Subject: [PATCH 6/7] Bump pxt-core to 0.2.100 --- package.json | 64 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index cab56e15..84e3ed0e 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ { - "name": "pxt-microbit", - "version": "0.2.91", - "description": "BBC micro:bit target for PXT", - "keywords": [ - "JavaScript", - "education", - "microbit" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/pxt-microbit.git" - }, - "author": "", - "license": "MIT", - "homepage": "https://github.com/Microsoft/pxt-microbit#readme", - "files": [ - "README.md", - "pxtarget.json", - "built/*.js", - "built/*.json", - "built/*.d.ts", - "sim/public", - "docs/*.md", - "docs/*/*.md", - "docs/*/*/*.md" - ], - "devDependencies": { - "typescript": "^1.8.7" - }, - "dependencies": { - "pxt-core": "0.2.99" - } + "name": "pxt-microbit", + "version": "0.2.91", + "description": "BBC micro:bit target for PXT", + "keywords": [ + "JavaScript", + "education", + "microbit" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/pxt-microbit.git" + }, + "author": "", + "license": "MIT", + "homepage": "https://github.com/Microsoft/pxt-microbit#readme", + "files": [ + "README.md", + "pxtarget.json", + "built/*.js", + "built/*.json", + "built/*.d.ts", + "sim/public", + "docs/*.md", + "docs/*/*.md", + "docs/*/*/*.md" + ], + "devDependencies": { + "typescript": "^1.8.7" + }, + "dependencies": { + "pxt-core": "0.2.100" + } } From 8431243b63251e7db1f09fac2f143db6af50c639 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 27 Apr 2016 13:38:07 -0700 Subject: [PATCH 7/7] 0.2.92 --- package.json | 64 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 84e3ed0e..245a7d2c 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ { - "name": "pxt-microbit", - "version": "0.2.91", - "description": "BBC micro:bit target for PXT", - "keywords": [ - "JavaScript", - "education", - "microbit" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/pxt-microbit.git" - }, - "author": "", - "license": "MIT", - "homepage": "https://github.com/Microsoft/pxt-microbit#readme", - "files": [ - "README.md", - "pxtarget.json", - "built/*.js", - "built/*.json", - "built/*.d.ts", - "sim/public", - "docs/*.md", - "docs/*/*.md", - "docs/*/*/*.md" - ], - "devDependencies": { - "typescript": "^1.8.7" - }, - "dependencies": { - "pxt-core": "0.2.100" - } + "name": "pxt-microbit", + "version": "0.2.92", + "description": "BBC micro:bit target for PXT", + "keywords": [ + "JavaScript", + "education", + "microbit" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Microsoft/pxt-microbit.git" + }, + "author": "", + "license": "MIT", + "homepage": "https://github.com/Microsoft/pxt-microbit#readme", + "files": [ + "README.md", + "pxtarget.json", + "built/*.js", + "built/*.json", + "built/*.d.ts", + "sim/public", + "docs/*.md", + "docs/*/*.md", + "docs/*/*/*.md" + ], + "devDependencies": { + "typescript": "^1.8.7" + }, + "dependencies": { + "pxt-core": "0.2.100" + } }