mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
btstack_run_loop_corefoundation: implement trigger exit
This commit is contained in:
parent
7b06a5623f
commit
dcf86b2997
@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
static struct timeval init_tv;
|
static struct timeval init_tv;
|
||||||
static CFAbsoluteTime init_cf;
|
static CFAbsoluteTime init_cf;
|
||||||
|
static CFRunLoopRef current_runloop;
|
||||||
|
|
||||||
static const btstack_run_loop_t btstack_run_loop_corefoundation;
|
static const btstack_run_loop_t btstack_run_loop_corefoundation;
|
||||||
|
|
||||||
@ -220,11 +221,17 @@ static void btstack_run_loop_corefoundation_init(void){
|
|||||||
init_cf = ((double)init_tv.tv_sec) + (((double)init_tv.tv_usec)/1000000.0) - kCFAbsoluteTimeIntervalSince1970; // unix time - since Jan 1st 1970
|
init_cf = ((double)init_tv.tv_sec) + (((double)init_tv.tv_usec)/1000000.0) - kCFAbsoluteTimeIntervalSince1970; // unix time - since Jan 1st 1970
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btstack_run_loop_corefoundation_execute(void)
|
static void btstack_run_loop_corefoundation_execute(void) {
|
||||||
{
|
current_runloop = CFRunLoopGetCurrent();
|
||||||
CFRunLoopRun();
|
CFRunLoopRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void btstack_run_loop_corefoundation_trigger_exit(void){
|
||||||
|
if (current_runloop != NULL){
|
||||||
|
CFRunLoopStop(current_runloop);
|
||||||
|
current_runloop = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
static void btstack_run_loop_corefoundation_dump_timer(void){
|
static void btstack_run_loop_corefoundation_dump_timer(void){
|
||||||
log_error("WARNING: btstack_run_loop_dump_timer not implemented!");
|
log_error("WARNING: btstack_run_loop_dump_timer not implemented!");
|
||||||
return;
|
return;
|
||||||
@ -249,5 +256,8 @@ static const btstack_run_loop_t btstack_run_loop_corefoundation = {
|
|||||||
&btstack_run_loop_corefoundation_execute,
|
&btstack_run_loop_corefoundation_execute,
|
||||||
&btstack_run_loop_corefoundation_dump_timer,
|
&btstack_run_loop_corefoundation_dump_timer,
|
||||||
&btstack_run_loop_corefoundation_get_time_ms,
|
&btstack_run_loop_corefoundation_get_time_ms,
|
||||||
|
NULL, /* poll data sources from irq */
|
||||||
|
NULL, /* execute on main thread */
|
||||||
|
&btstack_run_loop_corefoundation_trigger_exit,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user