<?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>MQX Software Solutions中的主题 Re: lwgpio interrupt problem</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197247#M4166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the problem comes from the vector that is the same for both pins.&lt;/P&gt;&lt;P&gt;I add a look to the code of _int_install_isr() in&amp;nbsp;mqx/source/kernel/int_iisr.c and ony one ISR function and data pointer can be supplied by vector. I you call _int_install_isr() more than one, the last one will be used.&lt;/P&gt;&lt;P&gt;But you can assign the same ISR function to different vectors; that's were the data pointer is usefull to help the function determine which vector caused the interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case, all port C has the same vector, so you could probably do as follows as a workaround :&lt;/P&gt;&lt;P&gt;- call ._int_install_isr() only once with a null data pointer&lt;/P&gt;&lt;P&gt;- in your ISR function, just set an event or semaphore to notice that the port has changed (without knowing which pin)&lt;/P&gt;&lt;P&gt;- in a task (or main task), wakeup on the event or semaphore and read level of each pin to check which one has changed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jan 2012 16:04:42 GMT</pubDate>
    <dc:creator>trailman</dc:creator>
    <dc:date>2012-01-17T16:04:42Z</dc:date>
    <item>
      <title>lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197243#M4162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;i have a custom board using a kinetis k60 and i don't seem to get my lwgpio isr properly working... 2 buttons (PortC14, PortC15) trigger interrupts on either edge, enter the same isr to set a lwevent depending on which button has been pressed...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i setup only one button to use interrupts (doesn't matter which one) everything works fine (except for the second interrupt)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what happens now is that, if i press the second button first (the one where the isr is registerd later) it works fine... if i then press the first button the isr gets called over and over again with the wrong pin as parameter passed to the isr (the second pin instead of the first)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea anyone?&lt;/P&gt;&lt;P&gt;thx,&lt;/P&gt;&lt;P&gt;joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sry about posting the code, couldn't attach the files...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ISR&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// callback for PortC, interrupts coming from HMI (2 pins)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;void PortC_int_callback(void *pin) {&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint_32 pinmask = ((LWGPIO_STRUCT_PTR)pin)-&amp;gt;pinmask;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;switch(pinmask) {&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;case(HMI_BUTTON1_MASK):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n PortC_int_callback entered, source: HMI_BUTTON1, pinmask: %x", pinmask);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_lwevent_set(&amp;amp;BUTTON1_LWEVENT, INT_EVENT_MASK) != MQX_OK) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nSet Event BUTTON1_LWEVENT failed");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_mqx_exit(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;case(HMI_BUTTON2_MASK):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n PortC_int_callback entered, source: HMI_BUTTON2, pinmask: %x", pinmask);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_lwevent_set(&amp;amp;BUTTON2_LWEVENT, INT_EVENT_MASK) != MQX_OK) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nSet Event BUTTON2_LWEVENT failed");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_mqx_exit(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;default:&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n PortC_int_callback entered, unknown int source");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;break;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR) pin);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;BUTTON SETUP&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // opening pin button1 as input&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!lwgpio_init(&amp;amp;btn1, HMI_BUTTON1, LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE)) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Initializing button GPIO as input failed.\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_task_block();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_set_functionality(&amp;amp;btn1, HMI_BUTTON1_MUX_GPIO);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_set_attribute(&amp;amp;btn1, LWGPIO_ATTR_PULL_UP, LWGPIO_AVAL_ENABLE);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// install interrupt service routine for button1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!lwgpio_int_init(&amp;amp;btn1, LWGPIO_INT_MODE_FALLING | LWGPIO_INT_MODE_RISING)) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Initializing button1 GPIO for interrupt failed.\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_task_block();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nButton1 configured for interrupt.");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_int_install_isr(lwgpio_int_get_vector(&amp;amp;btn1), PortC_int_callback, (void *) &amp;amp;btn1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_bsp_int_init(lwgpio_int_get_vector(&amp;amp;btn1), 3, 0, TRUE);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_int_enable(&amp;amp;btn1, TRUE);&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// opening pin button2 as input&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!lwgpio_init(&amp;amp;btn2, HMI_BUTTON2, LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE)) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Initializing button GPIO as input failed.\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_task_block();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_set_functionality(&amp;amp;btn2, HMI_BUTTON2_MUX_GPIO);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_set_attribute(&amp;amp;btn2, LWGPIO_ATTR_PULL_UP, LWGPIO_AVAL_ENABLE);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// install interrupt service routine for button2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!lwgpio_int_init(&amp;amp;btn2, LWGPIO_INT_MODE_FALLING | LWGPIO_INT_MODE_RISING)) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("Initializing button2 GPIO for interrupt failed.\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_task_block();&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nButton2 configured for interrupt.");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_int_install_isr(lwgpio_int_get_vector(&amp;amp;btn2), PortC_int_callback, (void *) &amp;amp;btn2);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_bsp_int_init(lwgpio_int_get_vector(&amp;amp;btn2), 3, 0, TRUE);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_int_enable(&amp;amp;btn2, TRUE);&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 20:39:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197243#M4162</guid>
      <dc:creator>joker441</dc:creator>
      <dc:date>2012-01-12T20:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197244#M4163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This looks like the data pointer set at the first&amp;nbsp; _int_install_isr() is overwritten by the second&amp;nbsp;_int_install_isr() so in the ISR you always get the second data pointer (&amp;amp;btn2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to use different int level/sublevel for both pins (at least a diferent sublevel). For example 3,0 and 3,1&lt;/P&gt;&lt;P&gt;Also check that the vector is different (should be) by doing a printf on lwgpio_int_get_vector(&amp;amp;btn1) and&amp;nbsp;lwgpio_int_get_vector(&amp;amp;btn2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also take care about printf in the "callback" function : as this is not a callback function but a real ISR (called from interrupt context), any printf will hang your system until completed. For test this is acceptable but not for a real application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Jan 2012 21:26:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197244#M4163</guid>
      <dc:creator>trailman</dc:creator>
      <dc:date>2012-01-14T21:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197245#M4164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;hi, thanks very much for your reply... i tried different priorities and subpriorities already (5,2 &amp;amp; 4,1) but the result stays the same... also when i do a printf on the two interrupt vectors i get the same result (0x69 for both), which is the vector for the port C interrupt.... i suppose you are right that something gets overwritten somewhere, but i have no clue where and how i should fix that... the lwgpio driver is also quite new if i remember correctly, maybe it still has a bug somewhere... any chance that somebody experienced the same problem already? cheers, j&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 01:17:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197245#M4164</guid>
      <dc:creator>joker441</dc:creator>
      <dc:date>2012-01-17T01:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197246#M4165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi joker441,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it might be more helpfull and easier if you attach your entire code, i will take a look or when i get a time i'll try replicate your scenario with the snapshot you provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;MartinK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 15:32:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197246#M4165</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2012-01-17T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197247#M4166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the problem comes from the vector that is the same for both pins.&lt;/P&gt;&lt;P&gt;I add a look to the code of _int_install_isr() in&amp;nbsp;mqx/source/kernel/int_iisr.c and ony one ISR function and data pointer can be supplied by vector. I you call _int_install_isr() more than one, the last one will be used.&lt;/P&gt;&lt;P&gt;But you can assign the same ISR function to different vectors; that's were the data pointer is usefull to help the function determine which vector caused the interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case, all port C has the same vector, so you could probably do as follows as a workaround :&lt;/P&gt;&lt;P&gt;- call ._int_install_isr() only once with a null data pointer&lt;/P&gt;&lt;P&gt;- in your ISR function, just set an event or semaphore to notice that the port has changed (without knowing which pin)&lt;/P&gt;&lt;P&gt;- in a task (or main task), wakeup on the event or semaphore and read level of each pin to check which one has changed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 16:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197247#M4166</guid>
      <dc:creator>trailman</dc:creator>
      <dc:date>2012-01-17T16:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197248#M4167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, thanks again for your effort... i built a demo project based on the code i posted above which illustrates the problem... i have it running on a custom board, the BSP is an adaption of the one for the tower K60 and the pins are defined at the top of main.c... greets, j&lt;/P&gt;&lt;P&gt;somehow i'm unable to attach a c-file directly... changed the name to .c.txt...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2012 17:30:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197248#M4167</guid>
      <dc:creator>joker441</dc:creator>
      <dc:date>2012-01-17T17:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197249#M4168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;one more interesting thing i discovered concerning the problem that the ISR gets entered over and over again:&lt;/P&gt;&lt;P&gt;i tried the approach trailman suggested, i read out all pins in the ISR, compare them to their previous value and set an lwevent depending on the pin and clear its interrupt flag, which works very fine.&lt;/P&gt;&lt;P&gt;the problem i found now is that clearing the interrupt flag of the corresponding pin also only works for the pin initialized latest, meaning that i have to clear the isr flag of btn2 and btn1 of i press button 1, otherwise the isr gets entered all over and over again....&lt;/P&gt;&lt;P&gt;generally i don't mind clearing flags and flags till none of them is left... it's not nice, but it helps &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;void PortC_int_callback(void *pin) {&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;btn1_val = lwgpio_get_value(&amp;amp;btn1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;btn2_val = lwgpio_get_value(&amp;amp;btn2);&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(btn1_val != btn1_prev_val) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n PortC_int_callback entered, source: HMI_BUTTON1, %i %i", btn1_val, btn2_val);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_lwevent_set(&amp;amp;BUTTON_LWEVENT, INT_EVENT_MASK) != MQX_OK) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nSet Event BUTTON_LWEVENT failed");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_mqx_exit(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR)&amp;amp;btn1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// clearing of btn2 interrupt flag required aswell! weird...&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR)&amp;amp;btn2);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(btn2_val != btn2_prev_val) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\n PortC_int_callback entered, source: HMI_BUTTON2, %i %i", btn1_val, btn2_val);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (_lwevent_set(&amp;amp;BUTTON_LWEVENT, INT_EVENT_MASK) != MQX_OK) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf("\nSet Event BUTTON_LWEVENT failed");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;_mqx_exit(0);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR)&amp;amp;btn2);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;btn1_prev_val = btn1_val;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;btn2_prev_val = btn2_val;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 20:11:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197249#M4168</guid>
      <dc:creator>joker441</dc:creator>
      <dc:date>2012-01-19T20:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197250#M4169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran into this same problem. The easiest way to solve it is using lwgpio_int_get_flag() to see which pin caused the interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if(lwgpio_int_get_flag(&amp;amp;btn1))  //Button 1 caused interrupt{  lwgpio_int_clear_flag(&amp;amp;btn1); //Clear interrupt flag}if(lwgpio_int_get_flag(&amp;amp;btn2)) //Button 2 caused interrupt{  lwgpio_int_clear_flag(&amp;amp;btn2); //Clear interrupt flag}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 04:03:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197250#M4169</guid>
      <dc:creator>anthony_huereca</dc:creator>
      <dc:date>2012-01-26T04:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: lwgpio interrupt problem</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197251#M4170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am also having same issue. Can anyone please confirm what is the correct fix for this? If I we use the following method (just to service interrupt from 1 pin at a time ) , does the the interrupt occurs until the flag is cleared ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ISR(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(lwgpio_int_get_flag(&amp;amp;btn1))&amp;nbsp; //Button 1 caused interrupt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lwgpio_int_clear_flag(&amp;amp;btn1); //Clear interrupt flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;else if&lt;/STRONG&gt;(lwgpio_int_get_flag(&amp;amp;btn2)) //Button 2 caused interrupt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lwgpio_int_clear_flag(&amp;amp;btn2); //Clear interrupt flag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I have added "&lt;STRONG&gt;else if&lt;/STRONG&gt;" in the above code to service interrupt from one pin at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohsin&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 17:38:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwgpio-interrupt-problem/m-p/197251#M4170</guid>
      <dc:creator>Mohsin455</dc:creator>
      <dc:date>2013-01-23T17:38:37Z</dc:date>
    </item>
  </channel>
</rss>

