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 }
int mp_hal_stdin_rx_chr(void) { for (;;) { int c = ringbuf_get(&input_buf); if (c != -1) { return c; } mp_hal_delay_us(1); } }
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(); } }
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 } }
void mp_hal_delay_ms(uint32_t delay) { mp_hal_delay_us(delay * 1000); }
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(); }
STATIC mp_obj_t time_sleep_us(mp_obj_t arg) { mp_hal_delay_us(mp_obj_get_int(arg)); return mp_const_none; }