esp_wifi/wifi/
os_adapter_esp32c3.rs
1use crate::hal::{interrupt, peripherals};
2
3pub(crate) fn chip_ints_on(mask: u32) {
4 unsafe {
5 peripherals::INTERRUPT_CORE0::regs()
6 .cpu_int_enable()
7 .modify(|r, w| w.bits(r.bits() | mask));
8 }
9}
10
11pub(crate) fn chip_ints_off(mask: u32) {
12 unsafe {
13 peripherals::INTERRUPT_CORE0::regs()
14 .cpu_int_enable()
15 .modify(|r, w| w.bits(r.bits() & !mask));
16 }
17}
18
19pub(crate) unsafe extern "C" fn set_intr(
20 _cpu_no: i32,
21 _intr_source: u32,
22 _intr_num: u32,
23 _intr_prio: i32,
24) {
25 }
33
34pub unsafe extern "C" fn set_isr(
50 n: i32,
51 f: *mut crate::binary::c_types::c_void,
52 arg: *mut crate::binary::c_types::c_void,
53) {
54 trace!("set_isr - interrupt {} function {:?} arg {:?}", n, f, arg);
55
56 match n {
57 0 => {
58 crate::wifi::ISR_INTERRUPT_1 = (f, arg);
59 }
60 1 => {
61 crate::wifi::ISR_INTERRUPT_1 = (f, arg);
62 }
63 _ => panic!("set_isr - unsupported interrupt number {}", n),
64 }
65
66 #[cfg(feature = "wifi")]
67 {
68 unwrap!(interrupt::enable(
69 peripherals::Interrupt::WIFI_MAC,
70 interrupt::Priority::Priority1
71 ));
72 unwrap!(interrupt::enable(
73 peripherals::Interrupt::WIFI_PWR,
74 interrupt::Priority::Priority1
75 ));
76 }
77}