SuperHouse / esp-open-rtos

Open source FreeRTOS-based ESP8266 software framework
BSD 3-Clause "New" or "Revised" License
1.52k stars 491 forks source link

stdin_uart: rewrite to use a FreeRTOS queue. #629

Closed ourairquality closed 6 years ago

ourairquality commented 6 years ago

Rewrite to have the IRQ handler read the character and place it in a FreeRTOS queue.

Was seeing odd RX errors with the prior driver, an occasional old character inserted. It only affected one particular device so might have been timing critical. Could not spot the problem, but toggling the interrupt enable outside the interrupt handler looked like trouble, so rewrote this to avoid that. This proposed rewrite reads the character from the fifo within the interrupt handler, and uses a FreeRTOS queue to queue them, and it also enables some RX error checking (parity, framing, breaks) and simple counters for these.