esp_hal/
debugger.rs

1//! Debugger utilities
2
3/// Checks if a debugger is connected.
4pub fn debugger_connected() -> bool {
5    #[cfg(xtensa)]
6    {
7        xtensa_lx::is_debugger_attached()
8    }
9
10    #[cfg(riscv)]
11    {
12        crate::peripherals::ASSIST_DEBUG::regs()
13            .core_0_debug_mode()
14            .read()
15            .core_0_debug_module_active()
16            .bit_is_set()
17    }
18
19    #[cfg(not(any(xtensa, riscv)))]
20    {
21        false
22    }
23}