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

@@ -224,15 +224,6 @@ typedef long mp_off_t;
#include "realpath.h"
#include "init.h"
#include "sleep.h"
#if MICROPY_ENABLE_SCHEDULER
// Use minimum 1mSec sleep to make sure there is effectively a wait period:
// something like usleep(500) truncates and ends up calling Sleep(0).
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) msec_sleep(MAX(1.0, (double)(TIMEOUT_MS)))
#else
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) /* No-op */
#endif
#ifdef __GNUC__
#define MP_NOINLINE __attribute__((noinline))

View File

@@ -27,6 +27,17 @@
#include "sleep.h"
#include "ports/unix/mphalport.h"
// Don't use the unix version of this macro.
#undef MICROPY_INTERNAL_WFE
#if MICROPY_ENABLE_SCHEDULER
// Use minimum 1mSec sleep to make sure there is effectively a wait period:
// something like usleep(500) truncates and ends up calling Sleep(0).
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) msec_sleep(MAX(1.0, (double)(TIMEOUT_MS)))
#else
#define MICROPY_INTERNAL_WFE(TIMEOUT_MS) /* No-op */
#endif
#define MICROPY_HAL_HAS_VT100 (0)
void mp_hal_move_cursor_back(unsigned int pos);