Forever moved to common sim
This commit is contained in:
parent
47e3737245
commit
bca5839b49
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user