How to watch for NVIC interrupts in application code

Thanks for both of you for the answer! Those helped me to get started with NVIC in general.
However it seems that void USBPhyHw::init() inside USBPhy_Maxim.cpp file already utilizes NVIC_SetVector function to register the _usbisr function to the USB interrupt. Furthermore _usbisr is defined as private.

If i am right(?) an NVIC interrupt can have only one interrupt handler function registered. If that is true, then i just can not run also a second user-defined function in case an USB interrupt occurs. So it seems i can not make any use of the USB_DEV_INTEN.vbus register bit of the MAX32630 chip.

Turns out the MAX32630FTHR has an onboard MAX14690 PMIC which has a register bit that keeps track if USB power is detected AND if that is a valid USB voltage. The PMIC can also generate an interrupt connected to P3_7 of the board, however the state of this pin does not change even if the register value of the PMIC updates when i plug/unplug the cable. So for some reason also this way does not seem to work.

Found a third possible way here. However the MAX32630FTHR’s pin definition does not contain any name for the VBUS pin that is located on the board…so i just can not make that an interrupt source…

Seems like i need to stick with the polling variant. :confused: