From d4b3ebc2e43d7ebdf28bd7af4e0988b549eff69d Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 26 Feb 2018 21:25:04 -0800 Subject: [PATCH] Missing updatestats (#351) * aligning screeninit with pxt32 * remove shim * missing shim * missing shim --- libs/core/screen.cpp | 5 +++++ libs/screen/targetoverrides.ts | 12 ++++-------- package.json | 2 +- sim/state/screen.ts | 6 ++++++ 4 files changed, 16 insertions(+), 9 deletions(-) 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