Compare commits

...

18 Commits

Author SHA1 Message Date
2798b579a6 0.2.43 2016-04-07 12:53:53 -07:00
9d23f82238 Bump pxt-core to 0.2.44 2016-04-07 12:53:51 -07:00
ce53d5c386 Renaming stuff in the simulator 2016-04-07 12:52:02 -07:00
5d3471b3b2 0.2.42 2016-04-07 11:41:51 -07:00
08b9b10ac8 Files renamed 2016-04-07 11:41:39 -07:00
404d7cc4a2 Bump pxt-core to 0.2.43 2016-04-07 11:41:23 -07:00
7c43739e4b Rename references 2016-04-07 11:30:22 -07:00
92d8adfdbd Rename json files 2016-04-07 11:30:07 -07:00
0f273131f6 0.2.41 2016-04-07 09:46:17 -07:00
9ae0c48477 Bump kindscript to 0.2.42 2016-04-07 09:46:15 -07:00
5f538f418e 0.2.40 2016-04-07 09:18:35 -07:00
859b68b6e3 Bump kindscript to 0.2.41 2016-04-07 09:18:33 -07:00
6576f7bd66 better handlings of logs 2016-04-07 09:03:21 -07:00
5a670f3291 0.2.39 2016-04-07 06:45:52 -07:00
7129487618 0.2.38 2016-04-07 06:34:15 -07:00
e1797b457a Bump kindscript to 0.2.39 2016-04-07 06:34:14 -07:00
c82efa452d 0.2.37 2016-04-07 04:48:45 -07:00
493014af01 Bump kindscript to 0.2.38 2016-04-07 04:48:43 -07:00
23 changed files with 56 additions and 58 deletions

View File

@ -2,9 +2,9 @@ language: node_js
node_js:
- "5.7.0"
script:
- "node node_modules/kindscript/built/kind.js travis"
- "(cd libs/lang-test0; node ../../node_modules/kindscript/built/kind.js run)"
- "node node_modules/kindscript/built/kind.js uploaddoc"
- "node node_modules/pxt-core/built/pxt.js travis"
- "(cd libs/lang-test0; node ../../node_modules/pxt-core/built/pxt.js run)"
- "node node_modules/pxt-core/built/pxt.js uploaddoc"
sudo: false
notifications:
email:

2
.vscode/tasks.json vendored
View File

@ -1,7 +1,7 @@
{
"version": "0.1.0",
// Task runner is jake
"command": "kind",
"command": "pxt",
// Need to be executed in shell / cmd
"isShellCommand": true,
"showOutput": "always",

View File

@ -1,4 +1,4 @@
/// <reference path="../node_modules/kindscript/built/kind.d.ts"/>
/// <reference path="../node_modules/pxt-core/built/pxt.d.ts"/>
import * as fs from 'fs';
import * as path from 'path';
@ -7,7 +7,7 @@ import * as child_process from 'child_process';
let writeFileAsync: any = Promise.promisify(fs.writeFile)
let execAsync: (cmd: string, options?: { cwd?: string }) => Promise<Buffer> = Promise.promisify(child_process.exec)
export function deployCoreAsync(res: ts.ks.CompileResult) {
export function deployCoreAsync(res: ts.pxt.CompileResult) {
return getBitDrivesAsync()
.then(drives => {
if (drives.length == 0) {
@ -40,4 +40,4 @@ function getBitDrivesAsync(): Promise<string[]> {
} else {
return Promise.resolve([])
}
}
}

View File

@ -2,7 +2,7 @@ namespace i2c_fram {
const devaddr = 0x50;
const memend = 0x7fff;
//% shim=ksrt::panic
//% shim=pxtrt::panic
function panic(code: number) { }
function die() { panic(142) }

View File

@ -3,7 +3,7 @@
// Do not use anything besides basic.pause, control.inBackground, console.log
//
//% shim=ksrt::panic
//% shim=pxtrt::panic
function panic(code2: number): void { }
function msg(s: string): void {

View File

@ -1,7 +1,7 @@
#include "kindscript.h"
#include "pxt.h"
#include "MESEvents.h"
using namespace kindscript;
using namespace pxt;
enum class MesCameraEvent {
//% block="take photo"

View File

@ -1,6 +1,6 @@
#include "kindscript.h"
#include "pxt.h"
using namespace kindscript;
using namespace pxt;
//% color=270 weight=34
namespace radio {
@ -15,7 +15,7 @@ namespace radio {
int r = uBit.radio.enable();
if (r != MICROBIT_OK) return r;
if (!radioEnabled) {
uBit.radio.setGroup(kindscript::programHash());
uBit.radio.setGroup(pxt::programHash());
radioEnabled = true;
}
return r;

View File

@ -154,7 +154,7 @@ namespace Array_ {
}
// Import some stuff directly
namespace kindscript {
namespace pxt {
//%
void registerWithDal(int id, int event, Action a);
//%
@ -181,7 +181,7 @@ namespace kindscript {
void *ptrOfLiteral(int offset);
}
namespace ksrt {
namespace pxtrt {
//%
uint32_t ldloc(RefLocal *r) {
return r->v;

View File

@ -1,7 +1,7 @@
#include "kindscript.h"
#include "pxt.h"
#include "ManagedBuffer.h"
using namespace kindscript;
using namespace pxt;
MicroBitPin *getPin(int id);
typedef ImageData* Image;
typedef BufferData* Buffer;

View File

@ -7,10 +7,10 @@
"dal.d.ts",
"enums.d.ts",
"shims.d.ts",
"ks-core.d.ts",
"pxt-core.d.ts",
"ksbit.h",
"core.cpp",
"ks-helpers.ts",
"pxt-helpers.ts",
"helpers.ts",
"images.cpp",
"basic.cpp",

View File

@ -1,7 +1,7 @@
{
"name": "kindscript-microbit",
"version": "0.2.36",
"description": "BBC micro:bit target for KindScript",
"name": "pxt-microbit",
"version": "0.2.43",
"description": "BBC micro:bit target for PXT",
"keywords": [
"JavaScript",
"education",
@ -9,14 +9,14 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/Microsoft/kindscript-microbit.git"
"url": "git+https://github.com/Microsoft/pxt-microbit.git"
},
"author": "",
"license": "MIT",
"homepage": "https://github.com/Microsoft/kindscript-microbit#readme",
"homepage": "https://github.com/Microsoft/pxt-microbit#readme",
"files": [
"README.md",
"kindtarget.json",
"pxtarget.json",
"built/*.js",
"built/*.json",
"built/*.d.ts",
@ -29,6 +29,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"kindscript": "0.2.36"
"pxt-core": "0.2.44"
}
}

View File

@ -59,7 +59,7 @@
"autoRun": true
},
"compileService": {
"gittag": "v0.1.5",
"gittag": "v0.1.6",
"serviceId": "ws"
},
"serial": {
@ -93,4 +93,4 @@
}
]
}
}
}

View File

@ -1,9 +1,9 @@
/// <reference path="../node_modules/kindscript/typings/bluebird/bluebird.d.ts"/>
/// <reference path="../node_modules/kindscript/built/kindsim.d.ts"/>
/// <reference path="../node_modules/pxt-core/typings/bluebird/bluebird.d.ts"/>
/// <reference path="../node_modules/pxt-core/built/pxtsim.d.ts"/>
/// <reference path="../libs/microbit/dal.d.ts"/>
namespace ks.rt {
ks.rt.initCurrentRuntime = () => {
namespace pxsim {
pxsim.initCurrentRuntime = () => {
U.assert(!runtime.board)
runtime.board = new Board()
}
@ -143,7 +143,7 @@ namespace ks.rt {
}
namespace ks.rt.basic {
namespace pxsim.basic {
export var pause = thread.pause;
export var forever = thread.forever;
@ -205,7 +205,7 @@ namespace ks.rt.basic {
}
}
namespace ks.rt.control {
namespace pxsim.control {
export var inBackground = thread.runInBackground;
export function reset() {
@ -213,7 +213,7 @@ namespace ks.rt.control {
}
export function onEvent(id: number, evid: number, handler: RefAction) {
kindscript.registerWithDal(id, evid, handler)
pxt.registerWithDal(id, evid, handler)
}
export function raiseEvent(id: number, evid: number, mode: number) {
@ -222,13 +222,13 @@ namespace ks.rt.control {
}
}
namespace ks.rt.kindscript {
namespace pxsim.pxt {
export function registerWithDal(id: number, evid: number, handler: RefAction) {
board().bus.listen(id, evid, handler);
}
}
namespace ks.rt.input {
namespace pxsim.input {
export function onButtonPressed(button: number, handler: RefAction): void {
let b = board();
if (button == DAL.MICROBIT_ID_BUTTON_AB && !board().usesButtonAB) {
@ -333,7 +333,7 @@ namespace ks.rt.input {
}
}
namespace ks.rt.led {
namespace pxsim.led {
export function plot(x: number, y: number) {
board().image.set(x, y, 255);
runtime.queueDisplayUpdate()
@ -367,7 +367,7 @@ namespace ks.rt.led {
}
}
namespace ks.rt.serial {
namespace pxsim.serial {
export function writeString(s: string) {
board().writeSerial(s);
}
@ -378,7 +378,7 @@ namespace ks.rt.serial {
}
namespace ks.rt.radio {
namespace pxsim.radio {
export function broadcastMessage(msg: number): void {
board().radio.broadcast(msg);
}
@ -416,7 +416,7 @@ namespace ks.rt.radio {
}
}
namespace ks.rt.pins {
namespace pxsim.pins {
export function digitalReadPin(pinId: number): number {
let pin = getPin(pinId);
if (!pin) return;
@ -504,12 +504,12 @@ namespace ks.rt.pins {
}
namespace ks.rt.images {
namespace pxsim.images {
export function createImage(img: Image) { return img }
export function createBigImage(img: Image) { return img }
}
namespace ks.rt.ImageMethods {
namespace pxsim.ImageMethods {
export function showImage(i: Image, offset: number) {
// TODO offset?
i.copyTo(0, 5, board().image, 0)

View File

@ -11,7 +11,7 @@
}
</style>
<script src="/cdn/bluebird.min.js"></script>
<script src="/cdn/kindsim.js"></script>
<script src="/cdn/pxtsim.js"></script>
<script src="/sim/sim.js"></script>
</head>

View File

@ -1,5 +1,5 @@
namespace ks.rt.micro_bit {
const Svg = ks.rt.Svg;
namespace pxsim.micro_bit {
const Svg = pxsim.Svg;
export interface IBoardTheme {
accent?: string;
@ -42,7 +42,7 @@ namespace ks.rt.micro_bit {
}
export interface IBoardProps {
runtime: ks.rt.Runtime;
runtime: pxsim.Runtime;
theme?: IBoardTheme;
disableTilt?:boolean;
}
@ -76,10 +76,10 @@ namespace ks.rt.micro_bit {
private thermometerText: SVGTextElement;
private shakeButton: SVGCircleElement;
private shakeText: SVGTextElement;
public board: rt.Board;
public board: pxsim.Board;
constructor(public props: IBoardProps) {
this.board = this.props.runtime.board as rt.Board;
this.board = this.props.runtime.board as pxsim.Board;
this.board.updateView = () => this.updateState();
this.buildDom();
this.updateTheme();
@ -115,7 +115,7 @@ namespace ks.rt.micro_bit {
Svg.fill(this.buttons[index], btn.pressed ? theme.buttonDown : theme.buttonUp);
});
var bw = state.displayMode == rt.DisplayMode.bw
var bw = state.displayMode == pxsim.DisplayMode.bw
var img = state.image;
this.leds.forEach((led,i) => {
var sel = (<SVGStylable><any>led)

View File

@ -1,4 +1,4 @@
namespace ks.rt {
namespace pxsim {
export interface RuntimeOptions {
theme: string;
}
@ -555,11 +555,11 @@ namespace ks.rt {
case 'yellow': theme = micro_bit.themes[1]; break;
case 'green': theme = micro_bit.themes[2]; break;
case 'red': theme = micro_bit.themes[3]; break;
default: theme = ks.rt.micro_bit.randomTheme();
default: theme = pxsim.micro_bit.randomTheme();
}
console.log('setting up microbit simulator')
let view = new ks.rt.micro_bit.MicrobitBoardSvg({
let view = new pxsim.micro_bit.MicrobitBoardSvg({
theme: theme,
runtime: runtime
})
@ -596,8 +596,8 @@ namespace ks.rt {
writeSerial(s: string) {
for (let i = 0; i < s.length; ++i) {
let c = s[i];
switch (c) {
case '\n':
this.serialOutBuffer += c;
if (c == '\n') {
Runtime.postMessage(<SimulatorSerialMessage>{
type: 'serial',
data: this.serialOutBuffer,
@ -605,8 +605,6 @@ namespace ks.rt {
})
this.serialOutBuffer = ''
break;
case '\r': continue;
default: this.serialOutBuffer += c;
}
}
}