Got it working, for reference with the Maple core, use this for interrupt pins 5-9:
nvic_irq_set_priority(NVIC_EXTI_9_5, 0);
And it helps to redefine the interrupt handler to only check the pins you're actually using.
extern "C" void __irq_exti9_5(void) {
digitalWrite(PC13, 0);
register uint32 pr = EXTI_BASE->PR;
register uint32 handled_msk = 0;
if(pr & 0x100) {
scl_s();
handled_msk = 0x100;
}
if(pr & 0x200) {
sda_s();
handled_msk |= 0x200;
}
EXTI_BASE->PR = (handled_msk);
asm volatile("nop");
asm volatile("nop");
digitalWrite(PC13, 1);
}
The "digitalWrite" lines are only for verification using a logic analyzer, they can be commented out when no longer needed. Not sure how necessary the "nop" lines are, they were part of the original interrupt handler and I'm sure there's a good reason why they're there.