ports: Move MICROPY_INTERNAL_WFE definition to mphalport.h.

It belongs here because the default value is defined in py/mphal.h.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-01-05 15:47:06 +11:00
parent d45176fc27
commit 0640ff3b97
6 changed files with 30 additions and 28 deletions

View File

@@ -221,12 +221,6 @@ static inline unsigned long mp_random_seed_init(void) {
#include <stdio.h>
#endif
// In lieu of a WFI(), slow down polling from being a tight loop.
//
// Note that we don't delay for the full TIMEOUT_MS, as execution
// can't be woken from the delay.
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) mp_hal_delay_us(500)
// Configure the implementation of machine.idle().
#include <sched.h>
#define MICROPY_UNIX_MACHINE_IDLE sched_yield();

View File

@@ -36,6 +36,12 @@
#define MICROPY_END_ATOMIC_SECTION(x) (void)x; mp_thread_unix_end_atomic_section()
#endif
// In lieu of a WFI(), slow down polling from being a tight loop.
//
// Note that we don't delay for the full TIMEOUT_MS, as execution
// can't be woken from the delay.
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) mp_hal_delay_us(500)
void mp_hal_set_interrupt_char(char c);
#define mp_hal_stdio_poll unused // this is not implemented, nor needed