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/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 00000000..9e681b2e Binary files /dev/null and b/docs/favicon.ico differ diff --git a/includes/docs-meta.html b/includes/docs-meta.html index 1593bfb3..32ba224e 100644 --- a/includes/docs-meta.html +++ b/includes/docs-meta.html @@ -1,21 +1,28 @@ - - - - - + + + + + - - - - - - - - - - - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index ab1638b4..212e0d6e 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) @@ -306,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 // diff --git a/package.json b/package.json index 9ffd2af5..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", @@ -29,6 +29,6 @@ "typescript": "^1.8.7" }, "dependencies": { - "pxt-core": "0.3.52" + "pxt-core": "0.3.55" } } 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": "." + } +}