File tree 6 files changed +30
-28
lines changed
6 files changed +30
-28
lines changed Original file line number Diff line number Diff line change @@ -245,19 +245,6 @@ extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
245
245
#define MICROPY_HW_BOOTSEL_DELAY_US 8
246
246
#endif
247
247
248
- // Port level Wait-for-Event macro
249
- //
250
- // Do not use this macro directly, include py/runtime.h and
251
- // call mp_event_wait_indefinite() or mp_event_wait_ms(timeout)
252
- #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) \
253
- do { \
254
- if ((TIMEOUT_MS) < 0) { \
255
- __wfe(); \
256
- } else { \
257
- best_effort_wfe_or_timeout(make_timeout_time_ms(TIMEOUT_MS)); \
258
- } \
259
- } while (0)
260
-
261
248
#define MICROPY_MAKE_POINTER_CALLABLE (p ) ((void *)((mp_uint_t)(p) | 1))
262
249
263
250
#define MP_SSIZE_MAX (0x7fffffff)
Original file line number Diff line number Diff line change 48
48
#define MICROPY_PY_LWIP_REENTER lwip_lock_acquire();
49
49
#define MICROPY_PY_LWIP_EXIT lwip_lock_release();
50
50
51
+ // Port level Wait-for-Event macro
52
+ //
53
+ // Do not use this macro directly, include py/runtime.h and
54
+ // call mp_event_wait_indefinite() or mp_event_wait_ms(timeout)
55
+ #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) \
56
+ do { \
57
+ if ((TIMEOUT_MS) < 0) { \
58
+ __wfe(); \
59
+ } else { \
60
+ best_effort_wfe_or_timeout(make_timeout_time_ms(TIMEOUT_MS)); \
61
+ } \
62
+ } while (0)
63
+
51
64
extern int mp_interrupt_char ;
52
65
extern ringbuf_t stdin_ringbuf ;
53
66
Original file line number Diff line number Diff line change @@ -221,12 +221,6 @@ static inline unsigned long mp_random_seed_init(void) {
221
221
#include <stdio.h>
222
222
#endif
223
223
224
- // In lieu of a WFI(), slow down polling from being a tight loop.
225
- //
226
- // Note that we don't delay for the full TIMEOUT_MS, as execution
227
- // can't be woken from the delay.
228
- #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) mp_hal_delay_us(500)
229
-
230
224
// Configure the implementation of machine.idle().
231
225
#include <sched.h>
232
226
#define MICROPY_UNIX_MACHINE_IDLE sched_yield();
Original file line number Diff line number Diff line change 36
36
#define MICROPY_END_ATOMIC_SECTION (x ) (void)x; mp_thread_unix_end_atomic_section()
37
37
#endif
38
38
39
+ // In lieu of a WFI(), slow down polling from being a tight loop.
40
+ //
41
+ // Note that we don't delay for the full TIMEOUT_MS, as execution
42
+ // can't be woken from the delay.
43
+ #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) mp_hal_delay_us(500)
44
+
39
45
void mp_hal_set_interrupt_char (char c );
40
46
41
47
#define mp_hal_stdio_poll unused // this is not implemented, nor needed
Original file line number Diff line number Diff line change @@ -224,15 +224,6 @@ typedef long mp_off_t;
224
224
225
225
#include "realpath.h"
226
226
#include "init.h"
227
- #include "sleep.h"
228
-
229
- #if MICROPY_ENABLE_SCHEDULER
230
- // Use minimum 1mSec sleep to make sure there is effectively a wait period:
231
- // something like usleep(500) truncates and ends up calling Sleep(0).
232
- #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) msec_sleep(MAX(1.0, (double)(TIMEOUT_MS)))
233
- #else
234
- #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) /* No-op */
235
- #endif
236
227
237
228
#ifdef __GNUC__
238
229
#define MP_NOINLINE __attribute__((noinline))
Original file line number Diff line number Diff line change 27
27
#include "sleep.h"
28
28
#include "ports/unix/mphalport.h"
29
29
30
+ // Don't use the unix version of this macro.
31
+ #undef MICROPY_INTERNAL_WFE
32
+
33
+ #if MICROPY_ENABLE_SCHEDULER
34
+ // Use minimum 1mSec sleep to make sure there is effectively a wait period:
35
+ // something like usleep(500) truncates and ends up calling Sleep(0).
36
+ #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) msec_sleep(MAX(1.0, (double)(TIMEOUT_MS)))
37
+ #else
38
+ #define MICROPY_INTERNAL_WFE (TIMEOUT_MS ) /* No-op */
39
+ #endif
40
+
30
41
#define MICROPY_HAL_HAS_VT100 (0)
31
42
32
43
void mp_hal_move_cursor_back (unsigned int pos );
You can’t perform that action at this time.
0 commit comments