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.
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