diff --git a/libs/i2c-fram/fram.ts b/libs/i2c-fram/fram.ts index 525cdb18..21366aee 100644 --- a/libs/i2c-fram/fram.ts +++ b/libs/i2c-fram/fram.ts @@ -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) } diff --git a/libs/lang-test0/lang-test0.ts b/libs/lang-test0/lang-test0.ts index 77070c32..db9b8f76 100644 --- a/libs/lang-test0/lang-test0.ts +++ b/libs/lang-test0/lang-test0.ts @@ -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 { diff --git a/libs/microbit-devices/devices.cpp b/libs/microbit-devices/devices.cpp index 3a5cb260..61509e58 100644 --- a/libs/microbit-devices/devices.cpp +++ b/libs/microbit-devices/devices.cpp @@ -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" diff --git a/libs/microbit-radio/radio.cpp b/libs/microbit-radio/radio.cpp index 433189cb..10b9a3fe 100644 --- a/libs/microbit-radio/radio.cpp +++ b/libs/microbit-radio/radio.cpp @@ -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; diff --git a/libs/microbit/core.cpp b/libs/microbit/core.cpp index 129fc518..daccdd7d 100644 --- a/libs/microbit/core.cpp +++ b/libs/microbit/core.cpp @@ -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; diff --git a/libs/microbit/ksbit.h b/libs/microbit/ksbit.h index abdf5d72..e182bdee 100644 --- a/libs/microbit/ksbit.h +++ b/libs/microbit/ksbit.h @@ -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; diff --git a/pxtarget.json b/pxtarget.json index 763ecdeb..21ad5562 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -59,7 +59,7 @@ "autoRun": true }, "compileService": { - "gittag": "v0.1.5", + "gittag": "v0.1.6", "serviceId": "ws" }, "serial": { @@ -93,4 +93,4 @@ } ] } -} \ No newline at end of file +} diff --git a/sim/libmbit.ts b/sim/libmbit.ts index 5bcfe312..98a0a02b 100644 --- a/sim/libmbit.ts +++ b/sim/libmbit.ts @@ -2,8 +2,8 @@ /// /// -namespace pxt.rt { - pxt.rt.initCurrentRuntime = () => { +namespace pxsim { + pxsim.initCurrentRuntime = () => { U.assert(!runtime.board) runtime.board = new Board() } @@ -143,7 +143,7 @@ namespace pxt.rt { } -namespace pxt.rt.basic { +namespace pxsim.basic { export var pause = thread.pause; export var forever = thread.forever; @@ -205,7 +205,7 @@ namespace pxt.rt.basic { } } -namespace pxt.rt.control { +namespace pxsim.control { export var inBackground = thread.runInBackground; export function reset() { @@ -213,7 +213,7 @@ namespace pxt.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 pxt.rt.control { } } -namespace pxt.rt.kindscript { +namespace pxsim.pxt { export function registerWithDal(id: number, evid: number, handler: RefAction) { board().bus.listen(id, evid, handler); } } -namespace pxt.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 pxt.rt.input { } } -namespace pxt.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 pxt.rt.led { } } -namespace pxt.rt.serial { +namespace pxsim.serial { export function writeString(s: string) { board().writeSerial(s); } @@ -378,7 +378,7 @@ namespace pxt.rt.serial { } -namespace pxt.rt.radio { +namespace pxsim.radio { export function broadcastMessage(msg: number): void { board().radio.broadcast(msg); } @@ -416,7 +416,7 @@ namespace pxt.rt.radio { } } -namespace pxt.rt.pins { +namespace pxsim.pins { export function digitalReadPin(pinId: number): number { let pin = getPin(pinId); if (!pin) return; @@ -504,12 +504,12 @@ namespace pxt.rt.pins { } -namespace pxt.rt.images { +namespace pxsim.images { export function createImage(img: Image) { return img } export function createBigImage(img: Image) { return img } } -namespace pxt.rt.ImageMethods { +namespace pxsim.ImageMethods { export function showImage(i: Image, offset: number) { // TODO offset? i.copyTo(0, 5, board().image, 0) diff --git a/sim/simsvg.ts b/sim/simsvg.ts index 9e07e8be..ab97067c 100644 --- a/sim/simsvg.ts +++ b/sim/simsvg.ts @@ -1,5 +1,5 @@ -namespace pxt.rt.micro_bit { - const Svg = pxt.rt.Svg; +namespace pxsim.micro_bit { + const Svg = pxsim.Svg; export interface IBoardTheme { accent?: string; @@ -42,7 +42,7 @@ namespace pxt.rt.micro_bit { } export interface IBoardProps { - runtime: pxt.rt.Runtime; + runtime: pxsim.Runtime; theme?: IBoardTheme; disableTilt?:boolean; } @@ -76,10 +76,10 @@ namespace pxt.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 pxt.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 = (led) diff --git a/sim/state.ts b/sim/state.ts index 41977876..9bd0c08b 100644 --- a/sim/state.ts +++ b/sim/state.ts @@ -1,4 +1,4 @@ -namespace pxt.rt { +namespace pxsim { export interface RuntimeOptions { theme: string; } @@ -555,11 +555,11 @@ namespace pxt.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 = pxt.rt.micro_bit.randomTheme(); + default: theme = pxsim.micro_bit.randomTheme(); } console.log('setting up microbit simulator') - let view = new pxt.rt.micro_bit.MicrobitBoardSvg({ + let view = new pxsim.micro_bit.MicrobitBoardSvg({ theme: theme, runtime: runtime })