esp8266: Support dedicated REPL loop (aka pull-style).

Event-driven loop (push-style) is still supported and default (controlled
by MICROPY_REPL_EVENT_DRIVEN setting, as expected).

Dedicated loop worked even without adding ets_loop_iter(), though that
needs to be revisited later.
This commit is contained in:
Paul Sokolovsky
2016-04-01 14:02:36 +03:00
parent 777232c9a5
commit 785cf9a61f
3 changed files with 28 additions and 1 deletions

View File

@@ -233,6 +233,7 @@ void soft_reset(void);
void mp_keyboard_interrupt(void);
int interrupt_char;
#if MICROPY_REPL_EVENT_DRIVEN
void uart_task_handler(os_event_t *evt) {
if (pyexec_repl_active) {
// TODO: Just returning here isn't exactly right.
@@ -264,3 +265,4 @@ void uart_task_handler(os_event_t *evt) {
void uart_task_init() {
system_os_task(uart_task_handler, UART_TASK_ID, uart_evt_queue, sizeof(uart_evt_queue) / sizeof(*uart_evt_queue));
}
#endif