diff options
| author | Jeff Epler <jepler@gmail.com> | 2021-01-09 13:59:54 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2021-01-09 14:02:47 -0600 |
| commit | e20c65d8f044cb9522cd1a7f4a3030efefa77cbb (patch) | |
| tree | 369c1a0bffa199d715c560a5c9ec42ed814d50d5 /supervisor/shared/background_callback.c | |
| parent | 4735cf4747764f0694e1285085e99f06a7a11a81 (diff) | |
background tasks: Add, use port_wake_main_task
Some ports need an extra operation to ensure that the main task is
awoken so that a queued background task will execute during an ongoing
light sleep.
This removes the need to enable supervisor ticks while I2SOut is operating.
Closes: #3952
Diffstat (limited to 'supervisor/shared/background_callback.c')
| -rw-r--r-- | supervisor/shared/background_callback.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index ef686cbab..288c9a4df 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -38,6 +38,8 @@ STATIC volatile background_callback_t *callback_head, *callback_tail; #define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts()) #define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts()) +MP_WEAK void port_wake_main_task(void) {} + void background_callback_add_core(background_callback_t *cb) { CALLBACK_CRITICAL_BEGIN; if (cb->prev || callback_head == cb) { @@ -55,6 +57,8 @@ void background_callback_add_core(background_callback_t *cb) { } callback_tail = cb; CALLBACK_CRITICAL_END; + + port_wake_main_task(); } void background_callback_add(background_callback_t *cb, background_callback_fun fun, void *data) { |
