This commit is contained in:
Michael Elliot Braun 2016-04-27 14:54:20 -07:00
commit f76235736a
6 changed files with 34 additions and 5 deletions

View File

@ -11,9 +11,7 @@ This example displays a random number every time the crocodile clip holds `GND`
### Connecting Crocodile Clips ### Connecting Crocodile Clips
![](/static/mb/crocodile-clips-1.jpg)
![](/static/mb/crocodile-clips-2.jpg)
### Lessons ### Lessons

View File

@ -163,4 +163,12 @@ namespace control {
StringData* deviceName() { StringData* deviceName() {
return ManagedString(microbit_friendly_name()).leakData(); return ManagedString(microbit_friendly_name()).leakData();
} }
/**
* Derive a unique, consistent serial number of this device from internal data.
*/
//%
int deviceSerialNumber() {
return microbit_serial_number();
}
} }

View File

@ -301,4 +301,18 @@ namespace pxtrt {
{ {
microbit_panic(code); microbit_panic(code);
} }
//
// Debugger
//
//%
uint32_t getNumGlobals() {
return numGlobals;
}
//%
void* getGlobalsPtr() {
return globals;
}
} }

View File

@ -348,6 +348,12 @@ declare namespace control {
*/ */
//% blockId="control_device_name" block="device name" weight=10 shim=control::deviceName //% blockId="control_device_name" block="device name" weight=10 shim=control::deviceName
function deviceName(): string; function deviceName(): string;
/**
* Derive a unique, consistent serial number of this device from internal data.
*/
//% shim=control::deviceSerialNumber
function deviceSerialNumber(): number;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-microbit", "name": "pxt-microbit",
"version": "0.2.91", "version": "0.2.92",
"description": "BBC micro:bit target for PXT", "description": "BBC micro:bit target for PXT",
"keywords": [ "keywords": [
"JavaScript", "JavaScript",
@ -29,6 +29,6 @@
"typescript": "^1.8.7" "typescript": "^1.8.7"
}, },
"dependencies": { "dependencies": {
"pxt-core": "0.2.99" "pxt-core": "0.2.100"
} }
} }

View File

@ -57,7 +57,10 @@
"deployDrives": "^MICROBIT" "deployDrives": "^MICROBIT"
}, },
"runtime": { "runtime": {
"mathBlocks": true "mathBlocks": true,
"loopBlocks": true,
"logicBlocks": true,
"variablesBlocks": true
}, },
"simulator": { "simulator": {
"autoRun": true "autoRun": true