jshTransmit: Is it interrupt driven? #4919
Replies: 1 comment
-
Posted at 2015-08-24 by @gfwilliams I actually wrote a little about this on the forum a week ago: http://forum.espruino.com/conversations/272743/#12452432 It's generally worth searching using google But yes, it's expecting that the contents of There's a Or is this again a side-effect of the way the ESP8266 has its own RTOS. Maybe it does it's own output buffering and IRQ-driven output? If you did |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-08-23 by Kolban
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:
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
Beta Was this translation helpful? Give feedback.
All reactions