Skip to content

Commit 134a77f

Browse files
authored
Merge pull request #10379 from jepler/event-hook
mpconfig: Use RUN_BACKGROUND_TASKS as the micropython event hook
2 parents 1d7e12d + 1ab8176 commit 134a77f

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

py/circuitpy_mpconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ void background_callback_run_all(void);
453453

454454
#define MICROPY_VM_HOOK_LOOP RUN_BACKGROUND_TASKS;
455455
#define MICROPY_VM_HOOK_RETURN RUN_BACKGROUND_TASKS;
456+
#define MICROPY_INTERNAL_EVENT_HOOK (RUN_BACKGROUND_TASKS)
456457

457458
// CIRCUITPY_AUTORELOAD_DELAY_MS = 0 will completely disable autoreload.
458459
#ifndef CIRCUITPY_AUTORELOAD_DELAY_MS

py/scheduler.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,6 @@ void mp_event_wait_indefinite(void) {
277277
MICROPY_EVENT_POLL_HOOK
278278
#else
279279
mp_event_handle_nowait();
280-
281-
// CIRCUITPY-CHANGE: don't starve CircuitPython background tasks
282-
RUN_BACKGROUND_TASKS;
283-
284280
MICROPY_INTERNAL_WFE(-1);
285281
#endif
286282
}
@@ -293,10 +289,6 @@ void mp_event_wait_ms(mp_uint_t timeout_ms) {
293289
MICROPY_EVENT_POLL_HOOK
294290
#else
295291
mp_event_handle_nowait();
296-
297-
// CIRCUITPY-CHANGE: don't starve CircuitPython background tasks
298-
RUN_BACKGROUND_TASKS;
299-
300292
MICROPY_INTERNAL_WFE(timeout_ms);
301293
#endif
302294
}

0 commit comments

Comments
 (0)