Beispiel #1
0
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;
}
Beispiel #2
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;
}
Beispiel #3
0
int mp_js_process_char(int c) {
    return pyexec_event_repl_process_char(c);
}