summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266/uart.c')
-rw-r--r--esp8266/uart.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/esp8266/uart.c b/esp8266/uart.c
index 6087668a70..87bbb7c92e 100644
--- a/esp8266/uart.c
+++ b/esp8266/uart.c
@@ -200,10 +200,16 @@ void ICACHE_FLASH_ATTR uart_reattach() {
// Task-based UART interface
-int pyexec_friendly_repl_process_char(int c);
+#include "py/obj.h"
+#include "stmhal/pyexec.h"
+
+void soft_reset(void);
void uart_task_handler(os_event_t *evt) {
- pyexec_friendly_repl_process_char(evt->par);
+ int ret = pyexec_event_repl_process_char(evt->par);
+ if (ret & PYEXEC_FORCED_EXIT) {
+ soft_reset();
+ }
}
void uart_task_init() {