btstack_run_loop_freertos: implement trigger exit

This commit is contained in:
Matthias Ringwald 2021-03-16 13:45:56 +01:00
parent d9d4921fd5
commit 38b6e83679
2 changed files with 13 additions and 4 deletions

View File

@ -162,10 +162,14 @@ void btstack_run_loop_freertos_trigger_from_isr(void){
}
#endif
void btstack_run_loop_freertos_trigger_exit(void){
static void btstack_run_loop_freertos_trigger_exit_internal(void){
run_loop_exit_requested = true;
}
void btstack_run_loop_freertos_trigger_exit(void){
btstack_run_loop_freertos_trigger_exit_internal();
}
/**
* Execute run_loop
*/
@ -254,6 +258,8 @@ static const btstack_run_loop_t btstack_run_loop_freertos = {
#else
NULL,
#endif
NULL,
&btstack_run_loop_freertos_trigger_exit_internal,
};
const btstack_run_loop_t * btstack_run_loop_freertos_get_instance(void){

View File

@ -52,11 +52,11 @@ extern "C" {
#endif
/**
* @brief Provide btstack_run_loop_freertos instance for use with btstack_run_loop_init
* @brief Get btstack_run_loop_freertos instance for use with btstack_run_loop_init
*/
const btstack_run_loop_t * btstack_run_loop_freertos_get_instance(void);
/*
/**
* @brief Execute code on BTstack run loop. Can be used to control BTstack from a different thread
*/
void btstack_run_loop_freertos_execute_code_on_main_thread(void (*fn)(void *arg), void * arg);
@ -70,12 +70,15 @@ 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
*
* @deprecated Please call btstack_run_loop_poll_data_sources_from_irq() instead
*/
void btstack_run_loop_freertos_trigger_from_isr(void);
/**
* @brief Triggers exit of run loop from BTstack main thread, causes call to btstack_run_loop_execute to return
*
* @deprecated Please call btstack_run_loop_trigger_exit() instead
*/
void btstack_run_loop_freertos_trigger_exit(void);