Forever moved to common sim

This commit is contained in:
Michal Moskal 2016-04-04 21:52:03 -07:00
parent 47e3737245
commit bca5839b49

View File

@ -145,6 +145,7 @@ namespace ks.rt {
namespace ks.rt.basic {
export var pause = thread.pause;
export var forever = thread.forever;
export function showNumber(x: number, interval: number) {
if (interval < 0) return;
@ -198,17 +199,6 @@ namespace ks.rt.basic {
scrollImage(leds, interval, 5);
}
export function forever(a: RefAction) {
function loop() {
runtime.runFiberAsync(a)
.then(() => Promise.delay(20))
.then(loop)
.done()
}
incr(a)
loop()
}
export function plotLeds(leds: Image): void {
leds.copyTo(0, 5, board().image, 0)
runtime.queueDisplayUpdate()