• the 3rd bullet-point doesn't start until all the many, available incoming data packets have been buffered

    Are you using a high baud rate, or is this still at 115200 baud?

    It looks to me like it starts as soon as data starts being received (so it doesn't have to have go to the end of an IPD packet). However it tries to be 'up to date' with the characters coming in from the UART before it moves on. It could be Espruino's handling of input data (rather than anything network-related) that's causing problems.

    For example it currently does:

    var limit = 128;
    while (hasInputCharacters() && limit--) {
      var data = "";
      while (data += popInputCharactersForDevice(SERIAL1));
      handleInputCharacters(data);
    }
    

    But I imagine what could happen is if characters keep coming in, it calls javascript with something a bit like:

    "lotsofdatalotsofdatalotsofdatalotsofdat­alotsofdatalotsofdatalotsofdata"
    "l" // by the time this is processed, another character has come in
    "o" // and so on
    "t"
    "s"
    
About

Avatar for Gordon @Gordon started