The use of the ESP8266 in the world of IoT

User avatar
By tve
#9993 Does anyone have some code to buffer uart output (TX) and send characters to the uart using an interrupt? The driver in the AT demo only uses interrupt for RX. Thanks!
User avatar
By igrr
#9997 I'm using TX interrupts in my code, take a look: https://gist.github.com/igrr/5c93c37e8f062e544ed7
It's not a self-contained driver, as it depends on a circular buffer class and some task switching functions (yield()), but you should be able to adapt it to your use case by writing proper _tx_empty_irq, _rx_complete_irq, write, and read functions.
The key insight here is to disable TX_FIFO_EMPTY interrupt whenever you don't have any more data to put into the FIFO.
User avatar
By hreintke
#10728 @tve
I looked at your code in esp8266-bridge as I am also working(learning) with FREERTOS.
I want to make a telnet connection to the esp8266, and when that is enabled forward all the "printf output" to that connection instead of the uart0.
When trying and reading about options and possibilities I read that the lwip is not thread safe and so all communication should take place in the same thread. I sometimes see unclear behaviour in my working environment but that also may be caused by other issues.
However, in your bridge, you use separate recv and transmit tasks, both with netconn and raw tcp.

- Did you notice any "thread-safe" issues when running ?
- You made both a netconn and rawIP version. Does any of the two have a preference ?

Kind regards,
Herman

PS : Thanks also for the better uart.c you posted on bbs.espreesif.com