From 4fd33db7036b1487a4b368055df28fd1c2023015 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 16 Mar 2021 11:34:53 +0100 Subject: [PATCH] btstack_run_loop_freertos: implement poll_data_sources_from_irq --- platform/freertos/btstack_run_loop_freertos.c | 10 +++++++++- platform/freertos/btstack_run_loop_freertos.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/freertos/btstack_run_loop_freertos.c b/platform/freertos/btstack_run_loop_freertos.c index 75e1d7661..07aa8bde7 100644 --- a/platform/freertos/btstack_run_loop_freertos.c +++ b/platform/freertos/btstack_run_loop_freertos.c @@ -142,7 +142,7 @@ void btstack_run_loop_freertos_execute_code_on_main_thread(void (*fn)(void *arg) } #if defined(HAVE_FREERTOS_TASK_NOTIFICATIONS) || (INCLUDE_xEventGroupSetBitFromISR == 1) -void btstack_run_loop_freertos_trigger_from_isr(void){ +static void btstack_run_loop_freertos_poll_data_sources_from_irq(void){ BaseType_t xHigherPriorityTaskWoken; #ifdef HAVE_FREERTOS_TASK_NOTIFICATIONS xTaskNotifyFromISR(btstack_run_loop_task, EVENT_GROUP_FLAG_RUN_LOOP, eSetBits, &xHigherPriorityTaskWoken); @@ -157,6 +157,9 @@ void btstack_run_loop_freertos_trigger_from_isr(void){ xEventGroupSetBitsFromISR(btstack_run_loop_event_group, EVENT_GROUP_FLAG_RUN_LOOP, &xHigherPriorityTaskWoken); #endif } +void btstack_run_loop_freertos_trigger_from_isr(void){ + btstack_run_loop_freertos_trigger_from_isr(); +} #endif void btstack_run_loop_freertos_trigger_exit(void){ @@ -246,6 +249,11 @@ static const btstack_run_loop_t btstack_run_loop_freertos = { &btstack_run_loop_freertos_execute, &btstack_run_loop_base_dump_timer, &btstack_run_loop_freertos_get_time_ms, +#if defined(HAVE_FREERTOS_TASK_NOTIFICATIONS) || (INCLUDE_xEventGroupSetBitFromISR == 1) + &btstack_run_loop_freertos_poll_data_sources_from_irq, +#else + NULL, +#endif }; const btstack_run_loop_t * btstack_run_loop_freertos_get_instance(void){ diff --git a/platform/freertos/btstack_run_loop_freertos.h b/platform/freertos/btstack_run_loop_freertos.h index 8587f6fe2..fb79bb8b8 100644 --- a/platform/freertos/btstack_run_loop_freertos.h +++ b/platform/freertos/btstack_run_loop_freertos.h @@ -70,6 +70,7 @@ void btstack_run_loop_freertos_trigger(void); /** * @brief Triggers processing of data sources from an ISR. * Has to be called after enabling a poll data source to wake-pup run loop. + * @deprecated Please use btstack_run_loop_poll_data_sources_from_irq() instead */ void btstack_run_loop_freertos_trigger_from_isr(void);