On the LPC17xx, you have interrupt enable registers for Port 0 and 2, see UM10360.pdf chapter 9.5.6 for reference. You have no GPIO interrupts on Port 1, 3 and 4 - you code appears to use Port 1.31, which cannot have GPIO interrupts.
In the exception handler
you must not forget to clear the intterupt flags in IO0IntClear
and IO2IntClear
. Failing to do so would re-trigger the handler function otherwise, even when using NVIC_ClearPendingIRQ()
.
The "correct" name for the handler function may depend on your toolchain.