Post Reply 
G1 problem with WAIT in latest firmware
08-06-2021, 06:44 AM (This post was last modified: 08-06-2021 11:21 PM by Gene222.)
Post: #5
RE: G1 problem with WAIT in latest firmware
(07-29-2021 07:53 PM)Jacob Wall Wrote:  On the G1, the WAIT(-1) is not working properly. It returns -1 immediately on subsequent calls (after the first successful run).

Should be easy to reproduce. This breaks every UI routine that relies on WAIT(-1). Anyone else found this and either have a workaround or has reported it?

WAIT(-1) works on my G1 hardware A calculator. WAIT(-1) will pause for 60 seconds, so the second loop is not needed. Review the help on WAIT. You need to address the three return actions, a key press, mouse tap, and timeout.

Code:
EXPORT TEST()
BEGIN
  LOCAL m=0;
  REPEAT
    RECT_P();
    TEXTOUT_P("Press a key, Esc to exit",G0,0,0);
    m:=WAIT(-1);
    IF TYPE(m)==0 THEN
      IF m==-1 THEN
        BREAK 1;
      ELSE
        TEXTOUT_P("Key " + m + " was pressed",G0,0,50);
        WAIT(0.7);
      END;
    ELSE
      TEXTOUT_P("Screen " + m + " was tapped",G0,0,50);
      WAIT(0.7);
      m:=0;
    END;
  UNTIL m==4;
END;

The above code was tapped out on my phone. So, there maybe some typos. EDIT. Corrected some typos.

EDIT. The mouse tap is kind of weird, because it returns three sets of information. This allows for gestures, such as a slide to the right.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: G1 problem with WAIT in latest firmware - Gene222 - 08-06-2021 06:44 AM



User(s) browsing this thread: 1 Guest(s)