示例#1
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
}
示例#2
0
int mp_hal_stdin_rx_chr(void) {
    for (;;) {
        int c = ringbuf_get(&input_buf);
        if (c != -1) {
            return c;
        }
        mp_hal_delay_us(1);
    }
}
示例#3
0
int mp_hal_stdin_rx_chr(void) {
    for (;;) {
        int c = uart0_rx();
        if (c != -1) {
            return c;
        }
        mp_hal_delay_us(1);
        mp_hal_feed_watchdog();
    }
}
示例#4
0
int mp_hal_stdin_rx_chr(void) {
    for (;;) {
        int c = ringbuf_get(&stdin_ringbuf);
        if (c != -1) {
            return c;
        }
        #if 0
        // Idles CPU but need more testing before enabling
        if (!ets_loop_iter()) {
            asm("waiti 0");
        }
        #else
        mp_hal_delay_us(1);
        #endif
    }
}
示例#5
0
void mp_hal_delay_ms(uint32_t delay) {
    mp_hal_delay_us(delay * 1000);
}
示例#6
0
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();
}
示例#7
0
STATIC mp_obj_t time_sleep_us(mp_obj_t arg) {
    mp_hal_delay_us(mp_obj_get_int(arg));
    return mp_const_none;
}