nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.62k stars 3.12k forks source link

uart: feed rx data to both lua console and on-data callback #3538

Closed jasaw closed 1 year ago

jasaw commented 1 year ago

UART on-data example usage with run_input set to 1:

uart.on(0, "data", 0,
  function(data)
    print("receive from uart:", data)
end, 1)

According to documentation for run_input:

If 1, input from UART will go into Lua interpreter, and run.

Currently, UART data either go into Lua interpreter or on-data callback. This PR fixes that.

jasaw commented 1 year ago

@jmattsson I can't assign you as a reviewer, so I just ping you here instead.

jmattsson commented 1 year ago

This looks like a needed alignment to the docs (and I suspect this might be my bug in the first place - apologies).