title: Cortex M-0: Simple external interrupt
body: <p>I'm trying to set up an external interrupt on my LPC812 uC. I've made the following code</p>
  
  <pre><code>#include "LPC8xx.h"
  
  #define RLED 7  // red LED
  
  bool pause = false;
  
  void PININT0_IRQHandler(void)
  {
    pause = !pause;
  }
  
  int main(void) {
  
  LPC_GPIO_PORT-&gt;DIR0 |= 1&lt;&lt;RLED; // set pin as output
  
  LPC_GPIO_PORT-&gt;SET0 = 1&lt;&lt;RLED;
  
  NVIC_EnableIRQ(PININT0_IRQn);
  
  while (1)
  {
      if(!pause)
      {
            LPC_GPIO_PORT-&gt;CLR0 = 1&lt;&lt;RLED;
      }
  }
  
  }
  </code></pre>
  
  <p>But it isn't working. Am I missing something? </p>