I would like to detect whether the debugger is attached so that in my error handler I will immediately break into the debugger, but in field units, the CPU will reset. Is there any way to detect if the debugger is attached?
void handle_error(){
if( debugger_attached ) BREAKPOINT;
RESET_CPU;
}