I have some code that is very specific to using the swd and sdio pins as inputs. When doing debugging I am looking for a way to disable this section of code and put it "test code" so I don't get error states. I know with the avr I can read the debug mode fuse, but I cannot find anything similar in the datasheet to know when the processor is debugging from a code point of view.
I am looking for something that would suit this use case:
if (!Register1234.Debugging) { //force debug pins sdio and swclk to PORT inputs when inactive PORTA.PMUX[15].reg = (1 << 4 | 1); PORTA.PINCFG[30].bit.INEN = 1; PORTA.PINCFG[31].bit.INEN = 1; PORTA.DIRCLR.reg = (1<< 30) | (1<< 31); }