You are reading a single comment by @Kolban and its replies. Click here to read the full conversation.
  • Howdy folks,
    I'm studying jsdevices.c which, if I understand correctly, is a device independent handler of certain I/O operations for boards. As I look into it, I find jshTransmit() which appears to want to transmit a character through the UART (or other transmission vehicle). If I read it correctly, there is a section of code where we check that the buffer for output characters has nearly filled (the headNext == tail) and then we execute a loop. The loop is:

    while(txHeadNext==txTail) {
    }
    

    I understand the logic ... but this seems to tell me that txTail will change outside of the primary flow of this loop and, since my target device is a single core processor, can only happen as the result of an interrupt being handled. What if UART doesn't generate interrupts on character consumption or otherwise needs processing logic? We might get into a deadlock here.

    Also, on my target device (the ESP8266), the WiFi subsystem needs to be "fed" regularly. We have a "yield()" type function and I'm wondering if this needs to be exposed as a jshardware.c exposed logical capability with an invocation within this tight loop?

    Still studying ... but I am hoping that there might be others in the community that have walked the insides of Espruino for board addition.

    Neil

About

Avatar for Kolban @Kolban started