summaryrefslogtreecommitdiff
path: root/esp8266/uart.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-05-06 00:02:58 +0100
committerDamien George <damien.p.george@gmail.com>2015-05-06 00:02:58 +0100
commitc98c128fe885e539ecd73843756340f8950115c8 (patch)
tree72030c7c91a12aea609edced0a233e1aa7d9c8cf /esp8266/uart.c
parent367d4d10983c0047d2f1c91ebe44a45e5f2bbf65 (diff)
pyexec: Make raw REPL work with event-driven version of pyexec.
esp8266 port now has working raw and friendly REPL, as well as working soft reset (CTRL-D at REPL, or raise SystemExit). tools/pyboard.py now works with esp8266 port.
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 6087668a7..87bbb7c92 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() {