diff options
| author | Damien George <damien@micropython.org> | 2022-07-15 12:12:57 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-07-18 18:12:39 +1000 |
| commit | e30e7ced6fa73605cd6ea5d943725e69e8501356 (patch) | |
| tree | 81b835036a4c4e19a6457a757b558f4e06b1a88d | |
| parent | 18ecc29bb8eedcc1f4fd999310467f0942eeaaac (diff) | |
unix/mpconfigport: Make MICROPY_EVENT_POLL_HOOK call usleep directly.
So that MICROPY_EVENT_POLL_HOOK can be used without including py/mphal.h.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/unix/mpconfigport.h | 2 | ||||
| -rw-r--r-- | ports/unix/unix_mphal.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 97846f81f..6397bcfbf 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -328,7 +328,7 @@ static inline unsigned long mp_urandom_seed_init(void) { do { \ extern void mp_handle_pending(bool); \ mp_handle_pending(true); \ - mp_hal_delay_us(500); \ + usleep(500); /* equivalent to mp_hal_delay_us(500) */ \ } while (0); #include <sched.h> diff --git a/ports/unix/unix_mphal.c b/ports/unix/unix_mphal.c index 80a7d1c8f..c224f7870 100644 --- a/ports/unix/unix_mphal.c +++ b/ports/unix/unix_mphal.c @@ -233,7 +233,7 @@ void mp_hal_delay_ms(mp_uint_t ms) { #ifdef MICROPY_EVENT_POLL_HOOK mp_uint_t start = mp_hal_ticks_ms(); while (mp_hal_ticks_ms() - start < ms) { - // MICROPY_EVENT_POLL_HOOK does mp_hal_delay_us(500) (i.e. usleep(500)). + // MICROPY_EVENT_POLL_HOOK does usleep(500). MICROPY_EVENT_POLL_HOOK } #else |
