From ce6959377a7e11f1361c3fd64227f8b98056c33c Mon Sep 17 00:00:00 2001 From: Sam El-Husseini <16690124+samelhusseini@users.noreply.github.com> Date: Mon, 18 Jun 2018 11:42:35 -0700 Subject: [PATCH] Add running time and event value support (#874) --- sim/state/misc.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sim/state/misc.ts b/sim/state/misc.ts index f1cddf6b..de0beb9c 100644 --- a/sim/state/misc.ts +++ b/sim/state/misc.ts @@ -66,15 +66,13 @@ namespace pxsim.control { board().bus.queue(id, evid) } - // TODO: (microbit master) - // export function eventTimestamp() { - // return board().bus.getLastEventTime() - // } + export function eventTimestamp() { + return board().bus.getLastEventTime() + } - // TODO: (microbit master) - // export function eventValue() { - // return board().bus.getLastEventValue() - // } + export function eventValue() { + return board().bus.getLastEventValue() + } } namespace pxsim.pxtcore { @@ -88,10 +86,9 @@ namespace pxsim.input { return runtime.runningTime(); } - // TODO: (microbit master) - // export function runningTimeMicros(): number { - // return runtime.runningTimeUs(); - // } + export function runningTimeMicros(): number { + return runtime.runningTimeUs(); + } export function calibrateCompass() { // device calibrates...