How to distinguish between GPIO interrupts from the same interrupt handler?
Read the EXTI-&gt;PR1 register to decide

void EXTI9_5_IRQHandler(void) {
    uint32_t pending = EXTI-&gt;PR1;
    if(pending &amp; (1 &lt;&lt; 5)) {
        EXTI-&gt;PR1 = 1 &lt;&lt; 5; // clear pending flag, otherwise we'd get endless interrupts
        // handle pin 5 here
    }
    if(pending &amp; (1 &lt;&lt; 6)) {
        EXTI-&gt;PR1 = 1 &lt;&lt; 6;
        // handle pin 6 here
    }
}