diff --git a/libs/core/screen.cpp b/libs/core/screen.cpp index 629c16ac..f7f20bb1 100644 --- a/libs/core/screen.cpp +++ b/libs/core/screen.cpp @@ -63,6 +63,11 @@ void updateScreen(Image img) { } } +//% +void updateStats(String str) { + +} + void screen_init() { DMESG("init screen"); if (mappedFrameBuffer) diff --git a/libs/screen/targetoverrides.ts b/libs/screen/targetoverrides.ts index b0dee8cb..23aeab17 100644 --- a/libs/screen/targetoverrides.ts +++ b/libs/screen/targetoverrides.ts @@ -5,25 +5,21 @@ //% groups=["0.,","1#*"] function img(lits: any, ...args: any[]): Image { return null } - let screen = image.create(DAL.LCD_WIDTH, DAL.LCD_HEIGHT) namespace _screen_internal { //% shim=pxt::updateScreen function updateScreen(img: Image): void {} + //% shim=pxt::updateStats + function updateStats(msg: string): void {} - control.addFrameHandler(200, () => { - updateScreen(screen) - }) - - updateScreen(screen) + control.setupScreenRefresh(() => updateScreen(screen)) export function _stats(msg: string) { - // show the msg somewhere - it contains frame rate etc + updateStats(msg) } } - namespace brick { export const LINE_HEIGHT = 12; diff --git a/package.json b/package.json index 999f04f9..346127b9 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "webfonts-generator": "^0.4.0" }, "dependencies": { - "pxt-common-packages": "0.20.4", + "pxt-common-packages": "0.20.5", "pxt-core": "3.4.9" }, "scripts": { diff --git a/sim/state/screen.ts b/sim/state/screen.ts index 68235d30..34275928 100644 --- a/sim/state/screen.ts +++ b/sim/state/screen.ts @@ -98,3 +98,9 @@ namespace pxsim.image { return image.ofBuffer(res) } } + +namespace pxsim.pxtcore { + export function updateStats(str: string) { + // TODO + } +} \ No newline at end of file