@@ -30,22 +30,22 @@ pub(super) struct osi_funcs_s {
30
30
version : u32 ,
31
31
set_isr : Option < unsafe extern "C" fn ( i32 , unsafe extern "C" fn ( ) , * const ( ) ) -> i32 > ,
32
32
ints_on : Option < unsafe extern "C" fn ( u32 ) > ,
33
- interrupt_disable : Option < unsafe extern "C" fn ( ) -> ( ) > ,
34
- interrupt_restore : Option < unsafe extern "C" fn ( ) -> ( ) > ,
35
- task_yield : Option < unsafe extern "C" fn ( ) -> ( ) > ,
36
- task_yield_from_isr : Option < unsafe extern "C" fn ( ) -> ( ) > ,
33
+ interrupt_disable : Option < unsafe extern "C" fn ( ) > ,
34
+ interrupt_restore : Option < unsafe extern "C" fn ( ) > ,
35
+ task_yield : Option < unsafe extern "C" fn ( ) > ,
36
+ task_yield_from_isr : Option < unsafe extern "C" fn ( ) > ,
37
37
semphr_create : Option < unsafe extern "C" fn ( u32 , u32 ) -> * const ( ) > ,
38
- semphr_delete : Option < unsafe extern "C" fn ( * const ( ) ) -> ( ) > ,
38
+ semphr_delete : Option < unsafe extern "C" fn ( * const ( ) ) > ,
39
39
semphr_take_from_isr : Option < unsafe extern "C" fn ( * const ( ) , * const ( ) ) -> i32 > ,
40
40
semphr_give_from_isr : Option < unsafe extern "C" fn ( * const ( ) , * const ( ) ) -> i32 > ,
41
41
semphr_take : Option < unsafe extern "C" fn ( * const ( ) , u32 ) -> i32 > ,
42
42
semphr_give : Option < unsafe extern "C" fn ( * const ( ) ) -> i32 > ,
43
43
mutex_create : Option < unsafe extern "C" fn ( ) -> * const ( ) > ,
44
- mutex_delete : Option < unsafe extern "C" fn ( * const ( ) ) -> ( ) > ,
44
+ mutex_delete : Option < unsafe extern "C" fn ( * const ( ) ) > ,
45
45
mutex_lock : Option < unsafe extern "C" fn ( * const ( ) ) -> i32 > ,
46
46
mutex_unlock : Option < unsafe extern "C" fn ( * const ( ) ) -> i32 > ,
47
47
queue_create : Option < unsafe extern "C" fn ( u32 , u32 ) -> * const ( ) > ,
48
- queue_delete : Option < unsafe extern "C" fn ( * const ( ) ) -> ( ) > ,
48
+ queue_delete : Option < unsafe extern "C" fn ( * const ( ) ) > ,
49
49
queue_send : Option < unsafe extern "C" fn ( * const ( ) , * const ( ) , u32 ) -> i32 > ,
50
50
queue_send_from_isr : Option < unsafe extern "C" fn ( * const ( ) , * const ( ) , * const ( ) ) -> i32 > ,
51
51
queue_recv : Option < unsafe extern "C" fn ( * const ( ) , * const ( ) , u32 ) -> i32 > ,
@@ -61,42 +61,42 @@ pub(super) struct osi_funcs_s {
61
61
u32 ,
62
62
) -> i32 ,
63
63
> ,
64
- task_delete : Option < unsafe extern "C" fn ( * const ( ) ) -> ( ) > ,
64
+ task_delete : Option < unsafe extern "C" fn ( * const ( ) ) > ,
65
65
is_in_isr : Option < unsafe extern "C" fn ( ) -> i32 > ,
66
66
cause_sw_intr_to_core : Option < unsafe extern "C" fn ( i32 , i32 ) -> i32 > ,
67
- malloc : Option < unsafe extern "C" fn ( u32 ) -> * const ( ) > ,
68
- malloc_internal : Option < unsafe extern "C" fn ( u32 ) -> * const ( ) > ,
69
- free : Option < unsafe extern "C" fn ( * const ( ) ) -> ( ) > ,
67
+ malloc : Option < unsafe extern "C" fn ( u32 ) -> * mut crate :: binary :: c_types :: c_void > ,
68
+ malloc_internal : Option < unsafe extern "C" fn ( u32 ) -> * mut crate :: binary :: c_types :: c_void > ,
69
+ free : Option < unsafe extern "C" fn ( * mut crate :: binary :: c_types :: c_void ) > ,
70
70
read_efuse_mac : Option < unsafe extern "C" fn ( * const ( ) ) -> i32 > ,
71
- srand : Option < unsafe extern "C" fn ( u32 ) -> ( ) > ,
71
+ srand : Option < unsafe extern "C" fn ( u32 ) > ,
72
72
rand : Option < unsafe extern "C" fn ( ) -> i32 > ,
73
73
btdm_lpcycles_2_hus : Option < unsafe extern "C" fn ( u32 , u32 ) -> u32 > ,
74
74
btdm_hus_2_lpcycles : Option < unsafe extern "C" fn ( u32 ) -> u32 > ,
75
75
btdm_sleep_check_duration : Option < unsafe extern "C" fn ( i32 ) -> i32 > ,
76
- btdm_sleep_enter_phase1 : Option < unsafe extern "C" fn ( i32 ) -> ( ) > ,
77
- btdm_sleep_enter_phase2 : Option < unsafe extern "C" fn ( ) -> ( ) > ,
78
- btdm_sleep_exit_phase1 : Option < unsafe extern "C" fn ( ) -> ( ) > ,
79
- btdm_sleep_exit_phase2 : Option < unsafe extern "C" fn ( ) -> ( ) > ,
80
- btdm_sleep_exit_phase3 : Option < unsafe extern "C" fn ( ) -> ( ) > ,
76
+ btdm_sleep_enter_phase1 : Option < unsafe extern "C" fn ( i32 ) > ,
77
+ btdm_sleep_enter_phase2 : Option < unsafe extern "C" fn ( ) > ,
78
+ btdm_sleep_exit_phase1 : Option < unsafe extern "C" fn ( ) > ,
79
+ btdm_sleep_exit_phase2 : Option < unsafe extern "C" fn ( ) > ,
80
+ btdm_sleep_exit_phase3 : Option < unsafe extern "C" fn ( ) > ,
81
81
coex_bt_wakeup_request : Option < unsafe extern "C" fn ( ) -> bool > ,
82
- coex_bt_wakeup_request_end : Option < unsafe extern "C" fn ( ) -> ( ) > ,
82
+ coex_bt_wakeup_request_end : Option < unsafe extern "C" fn ( ) > ,
83
83
coex_bt_request : Option < unsafe extern "C" fn ( u32 , u32 , u32 ) -> i32 > ,
84
84
coex_bt_release : Option < unsafe extern "C" fn ( u32 ) -> i32 > ,
85
85
coex_register_bt_cb : Option < unsafe extern "C" fn ( unsafe extern "C" fn ( ) ) -> i32 > ,
86
86
coex_bb_reset_lock : Option < unsafe extern "C" fn ( ) -> u32 > ,
87
87
coex_bb_reset_unlock : Option < unsafe extern "C" fn ( u32 ) > ,
88
88
coex_schm_register_btdm_callback : Option < unsafe extern "C" fn ( unsafe extern "C" fn ( ) ) -> i32 > ,
89
- coex_schm_status_bit_clear : Option < unsafe extern "C" fn ( i32 , i32 ) -> ( ) > ,
90
- coex_schm_status_bit_set : Option < unsafe extern "C" fn ( i32 , i32 ) -> ( ) > ,
89
+ coex_schm_status_bit_clear : Option < unsafe extern "C" fn ( i32 , i32 ) > ,
90
+ coex_schm_status_bit_set : Option < unsafe extern "C" fn ( i32 , i32 ) > ,
91
91
coex_schm_interval_get : Option < unsafe extern "C" fn ( ) -> u32 > ,
92
92
coex_schm_curr_period_get : Option < unsafe extern "C" fn ( ) -> u8 > ,
93
93
coex_schm_curr_phase_get : Option < unsafe extern "C" fn ( ) -> * const ( ) > ,
94
94
coex_wifi_channel_get : Option < unsafe extern "C" fn ( * mut u8 , * mut u8 ) -> i32 > ,
95
95
coex_register_wifi_channel_change_callback :
96
96
Option < unsafe extern "C" fn ( unsafe extern "C" fn ( ) ) -> i32 > ,
97
97
set_isr13 : Option < unsafe extern "C" fn ( i32 , unsafe extern "C" fn ( ) , * const ( ) ) -> i32 > ,
98
- interrupt_l3_disable : Option < unsafe extern "C" fn ( ) -> ( ) > ,
99
- interrupt_l3_restore : Option < unsafe extern "C" fn ( ) -> ( ) > ,
98
+ interrupt_l3_disable : Option < unsafe extern "C" fn ( ) > ,
99
+ interrupt_l3_restore : Option < unsafe extern "C" fn ( ) > ,
100
100
custom_queue_create :
101
101
Option < unsafe extern "C" fn ( u32 , u32 ) -> * mut crate :: binary:: c_types:: c_void > ,
102
102
coex_version_get : Option <
@@ -137,9 +137,9 @@ pub(super) static G_OSI_FUNCS: osi_funcs_s = osi_funcs_s {
137
137
task_delete : Some ( task_delete) ,
138
138
is_in_isr : Some ( is_in_isr) ,
139
139
cause_sw_intr_to_core : Some ( cause_sw_intr_to_core) ,
140
- malloc : Some ( malloc) ,
141
- malloc_internal : Some ( malloc_internal) ,
142
- free : Some ( free) ,
140
+ malloc : Some ( crate :: ble :: malloc) ,
141
+ malloc_internal : Some ( crate :: ble :: malloc_internal) ,
142
+ free : Some ( crate :: ble :: free) ,
143
143
read_efuse_mac : Some ( read_efuse_mac) ,
144
144
srand : Some ( crate :: ble:: btdm:: srand) ,
145
145
rand : Some ( crate :: ble:: btdm:: rand) ,
@@ -540,7 +540,7 @@ pub(crate) unsafe extern "C" fn set_isr(n: i32, f: unsafe extern "C" fn(), arg:
540
540
541
541
pub ( crate ) unsafe extern "C" fn ints_on ( mask : u32 ) {
542
542
trace ! ( "chip_ints_on esp32 {:b}" , mask) ;
543
- hal:: xtensa_lx:: interrupt:: enable_mask ( mask) ;
543
+ crate :: hal:: xtensa_lx:: interrupt:: enable_mask ( mask) ;
544
544
}
545
545
546
546
#[ cfg( coex) ]
@@ -571,15 +571,9 @@ fn async_wakeup_request(event: i32) -> bool {
571
571
let mut do_wakeup_request = false ;
572
572
573
573
match event {
574
- BTDM_ASYNC_WAKEUP_REQ_HCI => {
575
- request_lock = true ;
576
- }
577
- BTDM_ASYNC_WAKEUP_REQ_COEX => {
578
- request_lock = false ;
579
- }
580
- _ => {
581
- return false ;
582
- }
574
+ e if e == BTDM_ASYNC_WAKEUP_REQ_HCI => request_lock = true ,
575
+ e if e == BTDM_ASYNC_WAKEUP_REQ_COEX => request_lock = false ,
576
+ _ => return false ,
583
577
}
584
578
585
579
extern "C" {
@@ -614,15 +608,9 @@ fn async_wakeup_request_end(event: i32) {
614
608
let request_lock: bool ;
615
609
616
610
match event {
617
- BTDM_ASYNC_WAKEUP_REQ_HCI => {
618
- request_lock = true ;
619
- }
620
- BTDM_ASYNC_WAKEUP_REQ_COEX => {
621
- request_lock = false ;
622
- }
623
- _ => {
624
- return ;
625
- }
611
+ e if e == BTDM_ASYNC_WAKEUP_REQ_HCI => request_lock = true ,
612
+ e if e == BTDM_ASYNC_WAKEUP_REQ_COEX => request_lock = false ,
613
+ _ => return ,
626
614
}
627
615
628
616
extern "C" {
0 commit comments