mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +00:00
correct CFTimer creation
This commit is contained in:
parent
f70fee3346
commit
3c09d3b365
@ -101,11 +101,8 @@ int cocoa_remove_data_source(data_source_t *dataSource){
|
|||||||
|
|
||||||
void cocoa_add_timer(timer_source_t * ts)
|
void cocoa_add_timer(timer_source_t * ts)
|
||||||
{
|
{
|
||||||
|
|
||||||
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent();
|
|
||||||
CFTimeInterval fireDate = ((double)ts->timeout.tv_sec) + (((double)ts->timeout.tv_usec)/1000000.0);
|
CFTimeInterval fireDate = ((double)ts->timeout.tv_sec) + (((double)ts->timeout.tv_usec)/1000000.0);
|
||||||
|
CFRunLoopTimerRef timerRef = CFRunLoopTimerCreate (kCFAllocatorDefault,fireDate,0,0,0,theCFRunLoopTimerCallBack,(void*)ts);
|
||||||
CFRunLoopTimerRef timerRef = CFRunLoopTimerCreate (kCFAllocatorDefault,now+fireDate,fireDate,0,0,theCFRunLoopTimerCallBack,(void*)ts);
|
|
||||||
|
|
||||||
// hack: store CFRunLoopTimerRef in next pointer of linked_item
|
// hack: store CFRunLoopTimerRef in next pointer of linked_item
|
||||||
ts->item.next = (void *)timerRef;
|
ts->item.next = (void *)timerRef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user