<?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>topic Re: Interrupt does nothing in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869967#M51828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, now works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Apr 2019 18:26:11 GMT</pubDate>
    <dc:creator>javierhernande1</dc:creator>
    <dc:date>2019-04-01T18:26:11Z</dc:date>
    <item>
      <title>Interrupt does nothing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869965#M51826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this &lt;A href="https://github.com/fpv-github/vtx/blob/master/source/fpv-github-vtx.c" rel="nofollow noopener noreferrer" target="_blank"&gt;code&lt;/A&gt; in order to print a message when the SW3 is pressed but enter in the IF conditional and not print the message and it does not go back into the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using McuExpresso and SDK2.5, the gpios are&amp;nbsp;initialized from &lt;A href="https://github.com/fpv-github/vtx/blob/master/board/pin_mux.c" rel="nofollow noopener noreferrer" target="_blank"&gt;pin_mux.c&lt;/A&gt; and worsk fine with the numbers and letters in the 7 segment led display, but not the interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I initialize the interrupt also in &lt;A href="https://github.com/fpv-github/vtx/blob/master/board/pin_mux.c" rel="nofollow noopener noreferrer" target="_blank"&gt;pin_mux.c&lt;/A&gt;, instance of the source file? (as it's in the examples)&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* Init input switch GPIO.*/&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;amp;&amp;amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT)&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;GPIO_SetPinInterruptConfig&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_GPIO&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kGPIO_InterruptFallingEdge&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#else&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;PORT_SetPinInterruptConfig&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_PORT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPORT_InterruptFallingEdge&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#endif&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;EnableIRQ&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_IRQ&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;GPIO_PinInit&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_GPIO&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;sw_config&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2019 12:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869965#M51826</guid>
      <dc:creator>javierhernande1</dc:creator>
      <dc:date>2019-04-01T12:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt does nothing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869966#M51827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Javier, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked both your main and pinmux files, and I noticed that you don't set SW3 completely. When I tried your code on my side, I saw that you have a function at pinmux.c that you never use called "BOARD_InitButtonsPins" where you can see the configuration for SW3; based on this observation I just added this function inside your main function and with this I was able to call the SW3 interruption without any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;/* Define the init structure for the input switch pin */&lt;/SPAN&gt;
     gpio_pin_config_t sw_config &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
         kGPIO_DigitalInput&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

   &lt;SPAN class="comment token"&gt;/* Init board hardware. */&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;BOARD_InitBootPins&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;/**I added your function here!******************************************************/&lt;/SPAN&gt;

    &lt;SPAN class="token function"&gt;BOARD_InitButtonsPins&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;/*********************************************************************************/&lt;/SPAN&gt;

    &lt;SPAN class="token function"&gt;BOARD_InitBootClocks&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;BOARD_InitBootPeripherals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;/* Init FSL debug console. */&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;BOARD_InitDebugConsole&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Starting program!\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* Init input switch GPIO.*/&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) &amp;amp;&amp;amp; FSL_FEATURE_PORT_HAS_NO_INTERRUPT)&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;GPIO_SetPinInterruptConfig&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_GPIO&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kGPIO_InterruptFallingEdge&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#else&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;PORT_SetPinInterruptConfig&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_PORT&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kPORT_InterruptFallingEdge&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#endif&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;EnableIRQ&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_IRQ&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;GPIO_PinInit&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_SW_GPIO&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BOARD_SW_GPIO_PIN&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;sw_config&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;


 &lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;g_ButtonPress&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;//for(int i = 0; i&amp;lt;8;i++)&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;//{&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;PRINTF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"button pressed"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;//GPIO_PortToggle((void*)base[i], letter[4][i] &amp;lt;&amp;lt; pin[i]);&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;//PRINTF("Base %d, Pin %d\n",base[i],pin[i]);&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;//delay();&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* Reset state of button. */&lt;/SPAN&gt;
    g_ButtonPress &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; false&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;//}&lt;/SPAN&gt;
   &lt;SPAN class="comment token"&gt;//for (int i=0; i&amp;lt;8; i++){led[i] = number[4][i];}&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍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/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ricardo Delsordo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2019 15:52:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869966#M51827</guid>
      <dc:creator>nxf51211</dc:creator>
      <dc:date>2019-04-01T15:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt does nothing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869967#M51828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, now works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2019 18:26:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Interrupt-does-nothing/m-p/869967#M51828</guid>
      <dc:creator>javierhernande1</dc:creator>
      <dc:date>2019-04-01T18:26:11Z</dc:date>
    </item>
  </channel>
</rss>

