Skip to content

Commit 0c7726a

Browse files
committed
all: Use enum instead of bool argument to mp_handle_pending.
This should be a no-op because the enum and bool have the same numeric value. Signed-off-by: Damien George <damien@micropython.org>
1 parent 7484598 commit 0c7726a

24 files changed

Lines changed: 40 additions & 40 deletions

extmod/network_wiznet5k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void mpy_wiznet_yield(void) {
147147
#if MICROPY_PY_THREAD
148148
MICROPY_THREAD_YIELD();
149149
#else
150-
mp_handle_pending(true);
150+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS);
151151
#endif
152152
}
153153

ports/esp32/modsocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void socket_events_handler(void) {
156156
#endif // MICROPY_PY_SOCKET_EVENTS
157157

158158
static inline void check_for_exceptions(void) {
159-
mp_handle_pending(true);
159+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS);
160160
}
161161

162162
#if MICROPY_HW_ENABLE_MDNS_QUERIES

ports/esp32/mpconfigport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void *esp_native_code_commit(void *, size_t, void *);
309309
#if MICROPY_PY_THREAD
310310
#define MICROPY_EVENT_POLL_HOOK \
311311
do { \
312-
mp_handle_pending(true); \
312+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
313313
MICROPY_PY_SOCKET_EVENTS_HANDLER \
314314
MP_THREAD_GIL_EXIT(); \
315315
ulTaskNotifyTake(pdFALSE, 1); \
@@ -323,7 +323,7 @@ void *esp_native_code_commit(void *, size_t, void *);
323323
#endif
324324
#define MICROPY_EVENT_POLL_HOOK \
325325
do { \
326-
mp_handle_pending(true); \
326+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
327327
MICROPY_PY_SOCKET_EVENTS_HANDLER \
328328
MICROPY_PY_WAIT_FOR_INTERRUPT; \
329329
} while (0);

ports/esp32/mphalport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void mp_hal_delay_ms(mp_uint_t ms) {
197197
uint64_t dt;
198198
uint64_t t0 = esp_timer_get_time();
199199
for (;;) {
200-
mp_handle_pending(true);
200+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS);
201201
MICROPY_PY_SOCKET_EVENTS_HANDLER
202202
MP_THREAD_GIL_EXIT();
203203
uint64_t t1 = esp_timer_get_time();
@@ -240,7 +240,7 @@ void mp_hal_delay_us(mp_uint_t us) {
240240
if (dt + pend_overhead < us) {
241241
// we have enough time to service pending events
242242
// (don't use MICROPY_EVENT_POLL_HOOK because it also yields)
243-
mp_handle_pending(true);
243+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS);
244244
}
245245
}
246246
}

ports/esp8266/network_wlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static mp_obj_t esp_scan(mp_obj_t self_in) {
275275
// esp_scan_list variable to NULL without disabling interrupts
276276
if (MP_STATE_THREAD(mp_pending_exception) != NULL) {
277277
esp_scan_list = NULL;
278-
mp_handle_pending(true);
278+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS);
279279
}
280280
ets_loop_iter();
281281
}

ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define MICROPY_EVENT_POLL_HOOK \
77
do { \
8-
mp_handle_pending(true); \
8+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
99
} while (0);
1010

1111
// MIMXRT1170_EVK has 2 user LEDs

ports/mimxrt/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ extern const struct _mp_obj_type_t network_lan_type;
224224
#ifndef MICROPY_EVENT_POLL_HOOK
225225
#define MICROPY_EVENT_POLL_HOOK \
226226
do { \
227-
mp_handle_pending(true); \
227+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
228228
__WFE(); \
229229
} while (0);
230230
#endif

ports/nrf/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ long unsigned int rng_generate_random_word(void);
379379

380380
#define MICROPY_EVENT_POLL_HOOK \
381381
do { \
382-
mp_handle_pending(true); \
382+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
383383
__WFI(); \
384384
} while (0);
385385

ports/rp2/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
#ifndef MICROPY_PY_THREAD
138138
#define MICROPY_PY_THREAD (1)
139139
#define MICROPY_PY_THREAD_GIL (0)
140-
#define MICROPY_THREAD_YIELD() mp_handle_pending(true)
140+
#define MICROPY_THREAD_YIELD() mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS)
141141
#endif
142142

143143
// Extended modules

ports/samd/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171
#define MICROPY_EVENT_POLL_HOOK \
172172
do { \
173-
mp_handle_pending(true); \
173+
mp_handle_pending(MP_HANDLE_PENDING_CALLBACKS_AND_EXCEPTIONS); \
174174
__WFE(); \
175175
} while (0);
176176

0 commit comments

Comments
 (0)