pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
199 stars 167 forks source link

ESP32: Ctrl-F special key breaks existing code #137

Closed robert-hh closed 5 years ago

robert-hh commented 6 years ago

It's a breaking change and interferes with code, that expects a transparent interface from USB. That code would typically use micropython.kbd_intr(-1) to set the UART/Telnet to a transparent mode, as documented. Maybe we could agree in that key_intr(-1) disables both special interrupt characters. That would however require to change pyexec.c in addtion to machuart.c and telnet.c, because in pyexec the interrupt_char is already set to -1. But since the value of -1 in pyexec is an arbitrary internal one, and kbd_intr(-1) was already given as example in the documentation, it's better to change pyexec.c

Edit: Alternatively, kbd_intr() could get a second optional parameter to set the hard reset key, which is now Ctrl-F: kbd_intr(-1) sets both interrupt_char and reset_char to -1 kbd_intr(interrupt_char) would just set interrupt_char to the given value kbd_intr(interrupt_char, reset_char) sets both values.

Edit 2: For trial, I implemented both versions. The second alternative changes 6 files, but in a rather trivial way.

robert-hh commented 6 years ago

I added a PR for the second option: https://github.com/pycom/pycom-micropython-sigfox/pull/139

robert-hh commented 5 years ago

Implemented meanwhile (at least: almost). Thanks a lot