btstack_run_loop_windows: implement trigger exit

This commit is contained in:
Matthias Ringwald 2021-03-16 11:42:21 +01:00
parent 90d4f18637
commit 82b879d843

View File

@ -55,6 +55,7 @@
// start time. // start time.
static ULARGE_INTEGER start_time; static ULARGE_INTEGER start_time;
static bool run_loop_exit_requested;
/** /**
* @brief Queries the current time in ms since start * @brief Queries the current time in ms since start
@ -139,6 +140,10 @@ static void btstack_run_loop_windows_execute(void) {
} }
} }
static void btstack_run_loop_windows_trigger_exit(void){
run_loop_exit_requested = true;
}
// set timer // set timer
static void btstack_run_loop_windows_set_timer(btstack_timer_source_t *a, uint32_t timeout_in_ms){ static void btstack_run_loop_windows_set_timer(btstack_timer_source_t *a, uint32_t timeout_in_ms){
uint32_t time_ms = btstack_run_loop_windows_get_time_ms(); uint32_t time_ms = btstack_run_loop_windows_get_time_ms();
@ -173,6 +178,9 @@ static const btstack_run_loop_t btstack_run_loop_windows = {
&btstack_run_loop_windows_execute, &btstack_run_loop_windows_execute,
&btstack_run_loop_base_dump_timer, &btstack_run_loop_base_dump_timer,
&btstack_run_loop_windows_get_time_ms, &btstack_run_loop_windows_get_time_ms,
NULL, /* poll data sources from irq */
NULL,
btstack_run_loop_windows_trigger_exit
}; };
/** /**