Skip to content

Commit 0ea776c

Browse files
committed
adding timeouts
1 parent e392f05 commit 0ea776c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

screen.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace user_interface_base {
8989

9090
let timePassed = 0;
9191
while (!received) {
92-
if (timePassed % 33 == 0)
92+
if (timePassed % 60 == 0)
9393
radio.sendBuffer(buf);
9494
timePassed += 3;
9595
basic.pause(3)
@@ -155,8 +155,10 @@ namespace user_interface_base {
155155
public static drawTransparentImage(from: Bitmap, x: number, y: number) {
156156
for (let i = 0; i < this.bitmapCache.length; i++) {
157157
if (this.bitmapCache[i] == from) {
158-
radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, i, x, y]));
159-
this.waitForAck();
158+
// radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, i, x, y]));
159+
// this.waitForAck();
160+
161+
this.tryToSend(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, i, x, y]));
160162
return;
161163
}
162164
}
@@ -258,8 +260,9 @@ namespace user_interface_base {
258260
c: number
259261
) {
260262
// basic.showNumber(c)
261-
radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_FILL, c]));
262-
this.waitForAck();
263+
// radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_FILL, c]));
264+
// this.waitForAck();
265+
this.tryToSend(Buffer.fromArray([SCREEN_FN_ID_FILL, c]))
263266
}
264267

265268
public static fillRect(

0 commit comments

Comments
 (0)