esp_wifi/radio/
radio_esp32h2.rs

1#[cfg(feature = "ble")]
2use crate::{
3    binary,
4    hal::{interrupt, peripherals::Interrupt},
5};
6
7pub(crate) fn setup_radio_isr() {
8    // no-op
9}
10
11pub(crate) fn shutdown_radio_isr() {
12    #[cfg(feature = "ble")]
13    {
14        interrupt::disable(crate::hal::system::Cpu::ProCpu, Interrupt::LP_BLE_TIMER);
15        interrupt::disable(crate::hal::system::Cpu::ProCpu, Interrupt::BT_MAC);
16    }
17}
18
19#[cfg(feature = "ble")]
20#[no_mangle]
21extern "C" fn LP_BLE_TIMER() {
22    unsafe {
23        trace!("LP_TIMER interrupt");
24
25        let (fnc, arg) = crate::ble::npl::ble_os_adapter_chip_specific::ISR_INTERRUPT_3;
26
27        trace!("interrupt LP_TIMER {:?} {:?}", fnc, arg);
28
29        if !fnc.is_null() {
30            trace!("interrupt LP_TIMER call");
31
32            let fnc: fn(*mut binary::c_types::c_void) = core::mem::transmute(fnc);
33            fnc(arg);
34            trace!("LP_TIMER done");
35        }
36
37        trace!("interrupt LP_TIMER done");
38    };
39}
40
41#[cfg(feature = "ble")]
42#[no_mangle]
43extern "C" fn BT_MAC() {
44    unsafe {
45        trace!("BT_MAC interrupt");
46
47        let (fnc, arg) = crate::ble::npl::ble_os_adapter_chip_specific::ISR_INTERRUPT_15;
48
49        trace!("interrupt BT_MAC {:?} {:?}", fnc, arg);
50
51        if !fnc.is_null() {
52            trace!("interrupt BT_MAC call");
53
54            let fnc: fn(*mut binary::c_types::c_void) = core::mem::transmute(fnc);
55            fnc(arg);
56            trace!("BT_MAC done");
57        }
58
59        trace!("interrupt BT_MAC done");
60    };
61}