<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC MicrocontrollersのトピックRe: Why is the LPC804 going into IntDefaultHandler()?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998817#M39260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yup! it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ISR for the GPIO Interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// A GPIO interrupt has been detected.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;Enable the MRT &lt;SPAN style="text-decoration: underline;"&gt;oneshot&lt;/SPAN&gt; interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// so that you can check on the GPIO state in a specific amount of time.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// after it has settled out (&lt;SPAN style="text-decoration: underline;"&gt;debounced&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// Could check GPIO directly with&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;if(GPIO-&amp;gt;B[0][8] &amp;amp; 1)&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;// Is GPIO0_8 a 1? GPIO0_8 is the pushbutton&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// for C++ &lt;A href="https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code" target="test_blank"&gt;https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"C"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;PIN_INT0_IRQHandler&lt;/STRONG&gt;(&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// was an IRQ requested for Channel 0 of GPIO INT?&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; (PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; &amp;amp; (1&amp;lt;&amp;lt;0))&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// remove the any IRQ flag for Channel 0 of GPIO INT&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; = (1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// TOggle the LED&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;NOT&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;LED_USER2);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;//&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;asm&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"NOP"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// Place a &lt;SPAN style="text-decoration: underline;"&gt;breakpt&lt;/SPAN&gt; here if debugging.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2020 18:58:31 GMT</pubDate>
    <dc:creator>drsmith_yorku</dc:creator>
    <dc:date>2020-01-23T18:58:31Z</dc:date>
    <item>
      <title>Why is the LPC804 going into IntDefaultHandler()?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998814#M39257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to port ISR code for a pushbutton on the&amp;nbsp;LPC804 (OM40001) from C to C++14. &amp;nbsp;It works fine in C. &amp;nbsp;Unfortunately, in C++, my ISR isn't engaging when I push the pushbutton on the board. &amp;nbsp;Instead, the chip hangs in the while loop found in the IntDefaultHandler() generated by the SDK.&lt;/P&gt;&lt;P&gt;On the LPC804 board I'm using the User pushbutton on the main board and one of the LEDs on the add-on capacitive touch board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why this is happening and am looking for some advice as to how to figure it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #2a00ff; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;#include&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"LPC804.h"&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; LED_USER2 &lt;SPAN class=""&gt; &lt;/SPAN&gt;(20)&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// One of the LED on the capacitive touch board.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;(PIO0_20)&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; BUTTON_USER1&lt;SPAN class=""&gt; &lt;/SPAN&gt;(13)&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// GPIO 13 (PIO0_13) is connected to the button.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;main&lt;/STRONG&gt;(&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// disable interrupts&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;__disable_irq();&lt;SPAN class=""&gt; &lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// turn off globally&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;NVIC_DisableIRQ(&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;&lt;EM&gt;PIN_INT0_IRQn&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;SPAN class=""&gt; &lt;/SPAN&gt; &lt;/SPAN&gt;// turn off the PIN INT0 interrupt.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// ----------------------- Begin GPIO setup ------------------------------------&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Set up a general GPIO for use within the Interrupt Service Routine for MRT&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// Only the ISR needs the GPIO.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;(PB8 &amp;amp; PB9)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;SYSAHBCLKCTRL0&lt;/SPAN&gt; |= (&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON_SYSAHBCLKCTRL0_GPIO0_MASK |&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// GPIO is on&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON_SYSAHBCLKCTRL0_GPIO_INT_MASK);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// GPIO Interrupt is on&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Put 0 in the GPIO and GPIO Interrupt reset bit to reset it.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Then put a 1 in the GPIO and GPIO Interrupt reset bit to allow both to operate.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// manual: Section 6.6.10&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;PRESETCTRL0&lt;/SPAN&gt; &amp;amp;= ~(SYSCON_PRESETCTRL0_GPIO0_RST_N_MASK |&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON_PRESETCTRL0_GPIOINT_RST_N_MASK);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// reset GPIO and GPIO Interrupt &lt;SPAN class=""&gt; &lt;/SPAN&gt;(bit=0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;PRESETCTRL0&lt;/SPAN&gt; |= (SYSCON_PRESETCTRL0_GPIO0_RST_N_MASK |&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON_PRESETCTRL0_GPIOINT_RST_N_MASK);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// clear reset &lt;SPAN class=""&gt; &lt;/SPAN&gt;(bit=1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// &lt;SPAN style="text-decoration: underline;"&gt;Config&lt;/SPAN&gt; the Pushbutton&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;for input and LED&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;for output&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Remember: only bits set to 1 have an effect on DIRCLR and DIRSET registers.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;//&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;SPAN class=""&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;bits cleared to 0 are ignored.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;//&lt;SPAN class=""&gt; &lt;/SPAN&gt; Therefore, use DIRCLR to select input and DIRSET to select output&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;DIRCLR&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;BUTTON_USER1);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// input on (BUTTON_USER1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;CLR&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;LED_USER2);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// LED is on( &lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;turn off &lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;DIRSET&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;LED_USER2);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// output on&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;(LED_USER2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// ----------------------- end of GPIO setup -----------------------------------&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Set up GPIO IRQ: interrupt channel 0 (PINTSEL0) to GPIO&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;SYSCON-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;PINTSEL&lt;/SPAN&gt;[0] = BUTTON_USER1;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// PINTSEL0 is BUTTON_USER1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Configure the Pin interrupt mode register (a.k.a ISEL) for edge-sensitive&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// on PINTSEL0.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;0 is edge sensitive. 1 is level sensitive.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;ISEL&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; = 0x00;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// channel 0 bit is 0: is edge sensitive (so are the other channels)&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Use IENR or IENF (or S/CIENF or S/CIENR) to set edge type&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Configure &lt;SPAN style="text-decoration: underline;"&gt;Chan&lt;/SPAN&gt; 0 for only falling edge detection (no rising edge detection)&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;CIENR&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; = 0b00000001;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// bit 0 is 1: disable channel 0 IRQ for rising edge&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;SIENF&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; = 0b00000001;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// bit 0 is 1: enable channel 0 IRQ for falling edge&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// Remove any pending or left-over interrupt flags&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; = 0xFF;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// each bit set to 1 removes any pending flag.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// enable global interrupts &amp;amp; GPIO INT channel 0&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;NVIC_EnableIRQ(&lt;SPAN style="color: #0000c0;"&gt;&lt;EM&gt;PIN_INT0_IRQn&lt;/EM&gt;&lt;/SPAN&gt;);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// GPIO interrupt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;__enable_irq();&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;// global&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;/* Enter an infinite loop, check the pushbutton on GPIO8.*/&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;while&lt;/STRONG&gt;&lt;/SPAN&gt;(1)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;asm&lt;/STRONG&gt;&lt;/SPAN&gt;(&lt;SPAN style="color: #2a00ff;"&gt;"NOP"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/SPAN&gt; 0 ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ISR for the GPIO Interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// A GPIO interrupt has been detected.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;Enable the MRT &lt;SPAN style="text-decoration: underline;"&gt;oneshot&lt;/SPAN&gt; interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// so that you can check on the GPIO state in a specific amount of time.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// after it has settled out (&lt;SPAN style="text-decoration: underline;"&gt;debounced&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// Could check GPIO directly with&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;if(GPIO-&amp;gt;B[0][8] &amp;amp; 1)&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;// Is GPIO0_8 a 1? GPIO0_8 is the pushbutton&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;PIN_INT0_IRQHandler&lt;/STRONG&gt;(&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// was an IRQ requested for Channel 0 of GPIO INT?&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; (PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; &amp;amp; (1&amp;lt;&amp;lt;0))&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// remove the any IRQ flag for Channel 0 of GPIO INT&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; = (1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// TOggle the LED&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;NOT&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;LED_USER2);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;//&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;asm&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"NOP"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// Place a &lt;SPAN style="text-decoration: underline;"&gt;breakpt&lt;/SPAN&gt; here if debugging.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998814#M39257</guid>
      <dc:creator>drsmith_yorku</dc:creator>
      <dc:date>2020-01-23T17:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the LPC804 going into IntDefaultHandler()?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998815#M39258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this FAQ&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/389035"&gt;https://community.nxp.com/thread/389035&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 18:05:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998815#M39258</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2020-01-23T18:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the LPC804 going into IntDefaultHandler()?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998816#M39259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks! &amp;nbsp;Will try it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 18:48:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998816#M39259</guid>
      <dc:creator>drsmith_yorku</dc:creator>
      <dc:date>2020-01-23T18:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the LPC804 going into IntDefaultHandler()?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998817#M39260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yup! it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ISR for the GPIO Interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// A GPIO interrupt has been detected.&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;Enable the MRT &lt;SPAN style="text-decoration: underline;"&gt;oneshot&lt;/SPAN&gt; interrupt&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// so that you can check on the GPIO state in a specific amount of time.&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// after it has settled out (&lt;SPAN style="text-decoration: underline;"&gt;debounced&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// Could check GPIO directly with&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;if(GPIO-&amp;gt;B[0][8] &amp;amp; 1)&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;// Is GPIO0_8 a 1? GPIO0_8 is the pushbutton&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// for C++ &lt;A href="https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code" target="test_blank"&gt;https://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// ---------------------------------------&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"C"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;PIN_INT0_IRQHandler&lt;/STRONG&gt;(&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// was an IRQ requested for Channel 0 of GPIO INT?&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; (PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; &amp;amp; (1&amp;lt;&amp;lt;0))&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// remove the any IRQ flag for Channel 0 of GPIO INT&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;PINT-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;IST&lt;/SPAN&gt; = (1&amp;lt;&amp;lt;0);&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;// TOggle the LED&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;GPIO-&amp;gt;&lt;SPAN style="color: #0000c0;"&gt;NOT&lt;/SPAN&gt;[0] = (1UL&amp;lt;&amp;lt;LED_USER2);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f;"&gt;//&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;{&lt;/P&gt;&lt;P style="color: #3f7f5f; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055;"&gt;&lt;STRONG&gt;asm&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff;"&gt;"NOP"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;// Place a &lt;SPAN style="text-decoration: underline;"&gt;breakpt&lt;/SPAN&gt; here if debugging.&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="color: #7f0055; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 18:58:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Why-is-the-LPC804-going-into-IntDefaultHandler/m-p/998817#M39260</guid>
      <dc:creator>drsmith_yorku</dc:creator>
      <dc:date>2020-01-23T18:58:31Z</dc:date>
    </item>
  </channel>
</rss>

