Commit Graph

13 Commits

Author SHA1 Message Date
Johny Mattsson b0558d5bbe
Fix uart regressions & bugs (#2817)
* Fix uart regressions & bugs.

Using `uart.on()` with a search character was broken in that it did
not invoke the callback on a full UART buffer as documented. Logic reworked
to match docs again.

Fixed memory leak on `task_post()` failure (eep!).

Improved logic to attempt to coalesce input bytes to reduce the number of
`task_post()` slots used up by the platform uart.

Finally, added a semaphore to prevent the platform uart from overrunning
the `task_post()` slots all the time on high baud rates (e.g. 1mbit).
With the semaphore in there, the LVM RTOS task gets a chance to actually
process the received data and free up a `task_post()` slot or two.
The above mentioned read coalescing then allows the platform uart to
immediately catch up.

Also added an error log message if the `task_post()` actually does fail.

* Don't cache the uart delims.

Doing so makes reconfiguring those settings from within the callback not
take effect until the currently buffered bytes have been processed.
2019-10-13 09:49:44 +11:00
Javier Peletier 577e2ea8b2 uart: added uart.getconfig() (#2633) 2019-01-29 22:28:37 +01:00
Skirmantas Lauzikas 3257e557d4 ESP32: add support for RS485 (#2559)
* ESP32: add support for RS485

This commit adds support for switching UART mode to RS485/IRDA.
Also included are patches for memory leaks then handling UART events other than data.

* ESP32: Documentation for uart.setmode()
2018-11-30 12:07:05 +01:00
devsaurus 7448d21afa Updated ESP-IDF to latest. 2017-09-12 22:22:20 +02:00
devsaurus a56a7b2775 init ws2812_chains during platform_init 2017-06-20 23:09:14 +02:00
zelll 329bd73b63 ESP32: uart 1/2 supports (#1982)
* uart 1/2

* call -> pcall in uart_on_* functions

* fix docs

* fixed console driver when using custom console uart

* fixed line_inverse and error callback

* fixed a crash when uart.start() called more than one time
2017-06-13 18:33:32 +02:00
devsaurus 1117137363 fix compile warnings 2017-05-05 22:51:21 +02:00
zelll b7fa8c592f ADC extension for ESP32 (#1927)
* added adc extension

* add adc_number, for adc2
2017-04-24 21:36:01 +02:00
devsaurus 018a67a710 establish flushing of uart to leverage buffering putchar() 2017-04-18 22:43:03 +02:00
devsaurus 381726f103 add i2c module 2017-02-02 21:40:36 +01:00
devsaurus 4fcb1404b6 add simga_delta module 2017-01-13 22:34:24 +01:00
Johny Mattsson 9bbf8f43fb Successfully boot barebones NodeMCU on ESP32 (only).
RTOS driver evicted as it did not play nice with stdio etc.

Implemented a minimal driver to fully support Lua console on UART0. Output
on UART0 done via stdout (provided by the IDF). Input and setup handled
via driver_console/console.c. In addition to the direct input function
console_getc(), the driver also registers in the syscall tables to enable
regular stdio input functions to work (yay!). The Lua VM is still using the
direct interface since it's less overhead, but does also work when going
through stdin/fd 0.

Auto-bauding on the console is not yet functional; revisit when the UART docs
are available.

Module registration/linking/enabling moved over to be Kconfig based. See
updates to base_nodemcu/include/module.h and base_nodemcu/Kconfig for
details.

The sdk-overrides directory/approach is no longer used. The IDF is simply
too different to the old RTOS SDK - we need to adapt our code directly instead.

Everything in app/ is now unused, and will need to be gradually migrated
into components/ though it is probably better to migrate straight from the
latest dev branch.
2016-09-20 13:35:56 +10:00
Johny Mattsson a463d764eb WIP ESP32 IDF port.
Currently the UART driver break boot (or at least output).
2016-09-16 18:11:42 +10:00