/// Sleeps for `ms` milliseconds. /// /// @param ms Number of milliseconds to sleep /// @param ignoreinput If true, only SIGINT (CTRL-C) can interrupt. void os_delay(uint64_t ms, bool ignoreinput) { if (ignoreinput) { if (ms > INT_MAX) { ms = INT_MAX; } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, (int)ms, got_int); } else { os_microdelay(ms * 1000u, ignoreinput); } }
static bool input_poll(int ms) { if (do_profiling == PROF_YES && ms) { prof_inchar_enter(); } LOOP_PROCESS_EVENTS_UNTIL(&loop, NULL, ms, input_ready() || input_eof); if (do_profiling == PROF_YES && ms) { prof_inchar_exit(); } return input_ready(); }
static bool input_poll(int ms) { if (do_profiling == PROF_YES && ms) { prof_inchar_enter(); } if ((ms == - 1 || ms > 0) && !events_enabled && !input_eof) { // The pending input provoked a blocking wait. Do special events now. #6247 blocking = true; multiqueue_process_events(ch_before_blocking_events); } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof); blocking = false; if (do_profiling == PROF_YES && ms) { prof_inchar_exit(); } return input_ready(); }