summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/uart.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-12-20 13:58:58 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-03-05 22:01:27 +0200
commitd3a4d39687f941d12d727b80c79dd98ebae03674 (patch)
tree155e0c8a446f1cd4d8d99701c04bd271342464a6 /esp8266/uart.c
parent077448328a42e732c1ae3a063670b71914ed489c (diff)
downloadmicropython-d3a4d39687f941d12d727b80c79dd98ebae03674.tar.gz
micropython-d3a4d39687f941d12d727b80c79dd98ebae03674.zip
esp8266: Support raising KeyboardInterrupt on Ctrl+C.
Diffstat (limited to 'esp8266/uart.c')
-rw-r--r--esp8266/uart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/esp8266/uart.c b/esp8266/uart.c
index 49fc9bb87c..aa3d368b7c 100644
--- a/esp8266/uart.c
+++ b/esp8266/uart.c
@@ -210,10 +210,15 @@ void ICACHE_FLASH_ATTR uart_reattach() {
#include "lib/utils/pyexec.h"
void soft_reset(void);
+void mp_keyboard_interrupt(void);
+int interrupt_char;
void uart_task_handler(os_event_t *evt) {
int c, ret = 0;
while ((c = uart_rx_one_char(UART_REPL)) >= 0) {
+ if (c == interrupt_char) {
+ mp_keyboard_interrupt();
+ }
ret = pyexec_event_repl_process_char(c);
if (ret & PYEXEC_FORCED_EXIT) {
break;