Skip to content
Snippets Groups Projects
Commit 95fe7a40 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

zephyr: Support raw REPL.

parent 403c9305
No related branches found
No related tags found
No related merge requests found
...@@ -72,22 +72,23 @@ int real_main(void) { ...@@ -72,22 +72,23 @@ int real_main(void) {
#endif #endif
mp_init(); mp_init();
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt); MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
#if MICROPY_MODULE_FROZEN #if MICROPY_MODULE_FROZEN
pyexec_frozen_module("main.py"); pyexec_frozen_module("main.py");
#endif #endif
#if MICROPY_REPL_EVENT_DRIVEN
pyexec_event_repl_init();
for (;;) { for (;;) {
int c = mp_hal_stdin_rx_chr(); if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) {
if (pyexec_event_repl_process_char(c)) { if (pyexec_raw_repl() != 0) {
break;
}
} else {
if (pyexec_friendly_repl() != 0) {
break; break;
} }
} }
#else }
pyexec_friendly_repl();
#endif
//do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')", MP_PARSE_SINGLE_INPUT);
//do_str("for i in range(10):\r\n print(i)", MP_PARSE_FILE_INPUT);
mp_deinit(); mp_deinit();
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment