void init_done(void) { // Configure sleep, and put the radio to sleep if no interfaces are active wifi_fpm_set_sleep_type(MODEM_SLEEP_T); if (wifi_get_opmode() == NULL_MODE) { wifi_fpm_open(); wifi_fpm_do_sleep(0xfffffff); } #if MICROPY_REPL_EVENT_DRIVEN uart_task_init(); #endif mp_reset(); mp_hal_stdout_tx_str("\r\n"); #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); #endif #if !MICROPY_REPL_EVENT_DRIVEN soft_reset: for (;;) { if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { if (pyexec_raw_repl() != 0) { break; } } else { if (pyexec_friendly_repl() != 0) { break; } } } soft_reset(); goto soft_reset; #endif }
void init_done(void) { #if MICROPY_REPL_EVENT_DRIVEN uart_task_init(); #endif mp_reset(); mp_hal_stdout_tx_str("\r\n"); #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); #endif dupterm_task_init(); #if !MICROPY_REPL_EVENT_DRIVEN soft_reset: for (;;) { if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { if (pyexec_raw_repl() != 0) { break; } } else { if (pyexec_friendly_repl() != 0) { break; } } } soft_reset(); goto soft_reset; #endif }
int main(int argc, char **argv) { //int stack_dummy; //stack_top = (char*)&stack_dummy; uint32_t sp = gc_helper_get_sp(); gc_collect_init (sp); #if MICROPY_ENABLE_GC gc_init(heap, heap + sizeof(heap)); #endif mp_init(); pin_init0(); mp_irq_init0(); #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); for (;;) { int c = mp_hal_stdin_rx_chr(); if (pyexec_event_repl_process_char(c)) { 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(); return 0; }
int main(int argc, char **argv) { int stack_dummy; stack_top = (char*)&stack_dummy; memset(heap, 0, sizeof(heap)); memset(&mp_state_ctx, 0, sizeof(mp_state_ctx)); #if MICROPY_ENABLE_GC gc_init(heap, heap + sizeof(heap)); #endif mp_init(); #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); for (;;) { int c = mp_hal_stdin_rx_chr(); if (pyexec_event_repl_process_char(c)) { 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(); return 0; }
void soft_reset(void) { mp_hal_stdout_tx_str("PYB: soft reboot\r\n"); mp_hal_delay_us(10000); // allow UART to flush output mp_reset(); #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); #endif }
void mp_js_init_repl() { pyexec_event_repl_init(); }
void init_done(void) { mp_reset(); mp_hal_stdout_tx_str("\r\n"); pyexec_event_repl_init(); uart_task_init(); }
void soft_reset(void) { mp_hal_stdout_tx_str("PYB: soft reset\r\n"); mp_hal_delay_us(10000); // allow UART to flush output mp_reset(); pyexec_event_repl_init(); }