merging changes

This commit is contained in:
Peli de Halleux 2016-08-26 08:36:49 -07:00
commit a4063d636d
6 changed files with 64 additions and 51 deletions

View File

@ -9,16 +9,16 @@ let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Pr
let readDirAsync = Promise.promisify(fs.readdir) let readDirAsync = Promise.promisify(fs.readdir)
export function deployCoreAsync(res: ts.pxt.CompileResult) { export function deployCoreAsync(res: pxtc.CompileResult) {
return getBitDrivesAsync() return getBitDrivesAsync()
.then(drives => { .then(drives => {
if (drives.length == 0) { if (drives.length == 0) {
console.log("cannot find any drives to deploy to") console.log("cannot find any drives to deploy to")
} else { } 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 => 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(() => { .then(() => {
console.log("wrote hex file to " + d) console.log("wrote hex file to " + d)
})) }))

BIN
docs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,21 +1,28 @@
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@codethemicrobit" /> <meta name="twitter:site" content="@codethemicrobit" />
<meta name="twitter:title" content="@name@" /> <meta name="twitter:title" content="@name@" />
<meta name="twitter:description" content="@description@" /> <meta name="twitter:description" content="@description@" />
<meta name="twitter:image" content="@cardLogo@" /> <meta name="twitter:image" content="@cardLogo@" />
<meta property="og:title" content="@name@" /> <meta property="og:title" content="@name@" />
<meta property="og:site_name" content="code the micro:bit" /> <meta property="og:site_name" content="code the micro:bit" />
<meta property="og:description" content="@description@" /> <meta property="og:description" content="@description@" />
<meta property="og:image" content="@cardLogo@" /> <meta property="og:image" content="@cardLogo@" />
<!-- <!--
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="fb:app_id" content="" /> <meta property="fb:app_id" content="" />
--> -->
<link rel="apple-touch-icon" href="@appLogo@"> <link rel="apple-touch-icon" href="@appLogo@">
<link rel="icon" type="image/png" href="@appLogo@"> <link rel="icon" type="image/png" href="@appLogo@">
<link rel="mask-icon" href="https://az851932.vo.msecnd.net/pub/zwxazere/safari-pinned-tab.svg" color="#000000"> <link rel="mask-icon" href="https://az851932.vo.msecnd.net/pub/zwxazere/safari-pinned-tab.svg" color="#000000">
<link rel="shortcut icon" href="@appLogo@"> <link rel="shortcut icon" href="@appLogo@">
<meta name="theme-color" content="@accentColor@"> <meta name="theme-color" content="@accentColor@">
<style>
#root .avatar .avatar-image {
background-image: url(https://az851932.vo.msecnd.net/pub/jovrytni/microbit.simplified.svg);
background-size: contain;
background-repeat: no-repeat;
}
</style>

View File

@ -261,36 +261,6 @@ namespace pxtrt {
r->unref(); 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. // 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) RefAction *stclo(RefAction *a, int idx, uint32_t v)
@ -306,6 +276,34 @@ namespace pxtrt {
microbit_panic(code); 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 // Debugger
// //

View File

@ -1,6 +1,6 @@
{ {
"name": "pxt-microbit", "name": "pxt-microbit",
"version": "0.3.47", "version": "0.3.48",
"description": "micro:bit target for PXT", "description": "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.3.52" "pxt-core": "0.3.55"
} }
} }

8
tests/base/tsconfig.json Normal file
View File

@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"noImplicitAny": true,
"outDir": "built",
"rootDir": "."
}
}