Unexplained pauses

Posted on
  • Hello,

    Espruino looks like a great tool; however, I am having some difficulties.

    I am using an HYSTM32_24.

    I am using Espruino Web IDE. Connection to the board is fine, and it does operate some code.
    Occasionally codes will not run and the board will not respond, requiring a reset.

    Please could you explain why this code would work:

    LCD.clear();
    LCD.setColor(0, 0, 0.0);
    LCD.fillRect(0, 0, 320, 240);
    LCD.setFontBitmap();
    LCD.setColor(0, 1, 0);
    setTimeout(function() {
      LCD.drawString("> Line 1", 1, 10);
      LCD.drawString("> Line 2", 1, 30);
      }, 50);
    

    but this code would cause it to pause?

    LCD.clear();
    LCD.setColor(0, 0, 0.0);
    LCD.fillRect(0, 0, 320, 240);
    LCD.setFontBitmap();
    LCD.setColor(0, 1, 0);
    setTimeout(function() {
      LCD.drawString("> Line 1", 1, 10);
      LCD.drawString("> Line 2", 1, 30);
      LCD.drawString("> Line 3", 1, 50);
      }, 50);
    

    I am struggling to get three lines written one after the other!

    Many thanks,

    Harry

  • I should add that copying + pasting the lines in separately works just fine.

  • Ah - disconnecting from IDE itself and re-connecting seems to work. Sorry! Thanks.

  • This could well be a Web IDE problem. On non-Espruino boards I have to insert a delay between sending characters (because it doesn't know whether a serial or USB connection is being used) - and I think there may be some kind of regression in that code.

    I've put in a bug for it and I'll check it out when I get a second: https://github.com/espruino/EspruinoWebIDE/issues/27

  • Gordon - that solution feels right based on what I've observed. Also explains why pasting in works.

    Many thanks,
    Harry

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Unexplained pauses

Posted by Avatar for Harry_T @Harry_T

Actions