From 0756091e8cff5bf0471cd3545abddd3dab000077 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 11:09:18 +0200 Subject: [PATCH 01/10] Remove st/ldglb (no longer used) --- libs/microbit/core.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index ab1638b4..8e18ad65 100644 --- a/libs/microbit/core.cpp +++ b/libs/microbit/core.cpp @@ -261,36 +261,6 @@ namespace pxtrt { r->unref(); } - //% - uint32_t ldglb(int idx) { - check(0 <= idx && idx < numGlobals, ERR_OUT_OF_BOUNDS, 7); - return globals[idx]; - } - - //% - uint32_t ldglbRef(int idx) { - check(0 <= idx && idx < numGlobals, ERR_OUT_OF_BOUNDS, 7); - uint32_t tmp = globals[idx]; - incr(tmp); - return tmp; - } - - // note the idx comes last - it's more convenient that way in the emitter - //% - void stglb(uint32_t v, int idx) - { - check(0 <= idx && idx < numGlobals, ERR_OUT_OF_BOUNDS, 7); - globals[idx] = v; - } - - //% - void stglbRef(uint32_t v, int idx) - { - check(0 <= idx && idx < numGlobals, ERR_OUT_OF_BOUNDS, 7); - decr(globals[idx]); - globals[idx] = v; - } - // Store a captured local in a closure. It returns the action, so it can be chained. //% RefAction *stclo(RefAction *a, int idx, uint32_t v) From 0023710209c03205ae6fa15df59814e5731e5818 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 13:14:48 +0200 Subject: [PATCH 02/10] String/ptr -> boolean helpers added --- libs/microbit/core.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index 8e18ad65..212e0d6e 100644 --- a/libs/microbit/core.cpp +++ b/libs/microbit/core.cpp @@ -276,6 +276,34 @@ namespace pxtrt { microbit_panic(code); } + //% + int stringToBool(StringData *s) { + if (s == NULL) return 0; + if (s->len == 0) { + s->decr(); + return 0; + } + s->decr(); + return 1; + } + + //% + StringData* emptyToNull(StringData *s) { + if (!s || s->len == 0) + return NULL; + return s; + } + + //% + int ptrToBool(uint32_t p) { + if (p) { + decr(p); + return 1; + } else { + return 0; + } + } + // // Debugger // From 3a676c71519a0c3e0a3955a74ba3febec4da84da Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 13:18:34 +0200 Subject: [PATCH 03/10] Bump pxt-core to 0.3.53 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 190bb5d9..3087bed6 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "typescript": "^1.8.7" }, "dependencies": { - "pxt-core": "0.3.51" + "pxt-core": "0.3.53" } } From c79f043529ba5a6f6966a4371eaa7c77a4c342ec Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 13:18:35 +0200 Subject: [PATCH 04/10] 0.3.47 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3087bed6..ca9496f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pxt-microbit", - "version": "0.3.46", + "version": "0.3.47", "description": "micro:bit target for PXT", "keywords": [ "JavaScript", From 6fd14e718d9f1a2e6eb1c1abda9af7a9d1540602 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 15:19:04 +0200 Subject: [PATCH 05/10] Use the new pxtc namespace --- cmds/cmds.ts | 6 +++--- tests/base/tsconfig.json | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 tests/base/tsconfig.json diff --git a/cmds/cmds.ts b/cmds/cmds.ts index 727387d5..f4b99f42 100644 --- a/cmds/cmds.ts +++ b/cmds/cmds.ts @@ -9,16 +9,16 @@ let execAsync: (cmd: string, options?: { cwd?: string }) => Promise = Pr let readDirAsync = Promise.promisify(fs.readdir) -export function deployCoreAsync(res: ts.pxt.CompileResult) { +export function deployCoreAsync(res: pxtc.CompileResult) { return getBitDrivesAsync() .then(drives => { if (drives.length == 0) { console.log("cannot find any drives to deploy to") } else { - console.log(`copy ${ts.pxt.BINARY_HEX} to ` + drives.join(", ")) + console.log(`copy ${pxtc.BINARY_HEX} to ` + drives.join(", ")) } return Promise.map(drives, d => - writeFileAsync(d + ts.pxt.BINARY_HEX, res.outfiles[ts.pxt.BINARY_HEX]) + writeFileAsync(d + pxtc.BINARY_HEX, res.outfiles[pxtc.BINARY_HEX]) .then(() => { console.log("wrote hex file to " + d) })) diff --git a/tests/base/tsconfig.json b/tests/base/tsconfig.json new file mode 100644 index 00000000..1ba59f2c --- /dev/null +++ b/tests/base/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "noImplicitAny": true, + "outDir": "built", + "rootDir": "." + } +} From d90a43a6d83f8c0e3c1aae93c60e61332b73b262 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 15:24:48 +0200 Subject: [PATCH 06/10] Bump pxt-core to 0.3.55 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca9496f6..8a5e2100 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "typescript": "^1.8.7" }, "dependencies": { - "pxt-core": "0.3.53" + "pxt-core": "0.3.55" } } From 13b21ad275f2f6c1b70b3faaa3597387d67256ff Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 15:24:48 +0200 Subject: [PATCH 07/10] 0.3.48 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8a5e2100..bb15b41e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pxt-microbit", - "version": "0.3.47", + "version": "0.3.48", "description": "micro:bit target for PXT", "keywords": [ "JavaScript", From 4d8afdd3ae51a25eeee5786696312073aef588a6 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 16:12:22 +0200 Subject: [PATCH 08/10] Format --- includes/docs-meta.html | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/includes/docs-meta.html b/includes/docs-meta.html index 1593bfb3..8a146b07 100644 --- a/includes/docs-meta.html +++ b/includes/docs-meta.html @@ -1,21 +1,20 @@ - - - - - + + + + + - - - - - - - - - - - \ No newline at end of file + + + + + From 51d285b0b0480996a8bb1ae987fe1602ee3fe722 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 16:15:58 +0200 Subject: [PATCH 09/10] Set target-specific avatar; fixes https://github.com/Microsoft/pxt/issues/97 --- includes/docs-meta.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/docs-meta.html b/includes/docs-meta.html index 8a146b07..32ba224e 100644 --- a/includes/docs-meta.html +++ b/includes/docs-meta.html @@ -18,3 +18,11 @@ + + \ No newline at end of file From 92b5b7617162aa4f3ac7454030dfd569b6ef551f Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 26 Aug 2016 16:35:13 +0200 Subject: [PATCH 10/10] Add target-specific favicon; see https://github.com/Microsoft/pxt/issues/54 --- docs/favicon.ico | Bin 0 -> 1150 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/favicon.ico diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9e681b2e95a879bc5e94bf63af6b6c5991b30065 GIT binary patch literal 1150 zcmb_Y%Wl&^6rG7};XM3E8oP;7NRyH@Y93A+DTq=LMajBJHZ0h&f^Q%+pMX@c;#n#c zRY(OSb|5GS5D(E!`43ixirwMPR4xTYEDB?tnS1X!XXg4c#_6+dM*A$gqB7<(#!3V# zQRSdc2V=w~q6d)qf7mLwb}m-eKV5BX?T)KApIxhOz8^KW_r}dfdt>kZn~}HiZq$7I zW!!kUyIOznaa7;@u-e%AJQlIH{`x}s#?$@UotF?;xW0|r-5q!vZ{gj01-g&$9Hc{y zasg4R-F_kU<+Uf@t>*cCv$2e5sg7vTgXt~7sI(By7Gc(x2XC&5DsxT--l-wRN^AIfSl=M2z0&F{r5cL;$gw`}osH%!wF6XbT^wI5h!8s?LN_8En^dc$+Vy-C*(iRoIFdhd~1^b+mX9|@ifbz lF6J7<6V9&_YJbxo<$f^EFOh%kc;J`G_fHF=n`18F{R!L{BR&8C literal 0 HcmV?d00001