<?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>S32KのトピックbuttonISR Issue</title>
    <link>https://community.nxp.com/t5/S32K/buttonISR-Issue/m-p/1527143#M17901</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm facing the issue with buttonISR, In my code i'm checking the Pin Pressed Status like below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uint32_t buttonsPressed = ((PINS_DRV_GetPortIntFlag(BTN_PORT_D) | PINS_DRV_GetPortIntFlag(BTN_PORT)) &amp;amp; ((1 &amp;lt;&amp;lt; BTN1_PIN) | (1 &amp;lt;&amp;lt; BTN2_PIN) | (1 &amp;lt;&amp;lt; BTN3_PIN) | (1 &amp;lt;&amp;lt; BTN4_PIN) | (1 &amp;lt;&amp;lt; BTN5_PIN) | (1 &amp;lt;&amp;lt; BTN6_PIN) | (1 &amp;lt;&amp;lt; BTN7_PIN)));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.If i add no.of pins then need to increase the no.of Pin Status check lines-&amp;gt;Pease give the Solution without increasing the Lines of code&amp;nbsp; to check the Pin Status.&lt;/P&gt;&lt;P&gt;2.The Above Logic for Pin Press Status check for 2 Port pins(Port C and Port D)-As per the Above logic it 'll works only there is a difference in the Selected Port Pins(Port C-1,2,3,4,5 and Port D-6,7,8,9,10 ), But It'll not work if i select the Same pins i Different Ports(Port C-1,2,3,4,5 and Port D-1,2,3,4,5)---Please give the Solution for this.&lt;/P&gt;&lt;P&gt;3.I'm Checking the Particular Pin is Pressed or not Status using the Switch case only like below,So it'll check Sequentially--Is there any option to check the Pin Status at a time Parallelly.&lt;/P&gt;&lt;P&gt;4.Is there any Predefined Function to Check the Debounce of the Switch, Please Provide the Debounce&lt;/P&gt;&lt;P&gt;Function or Useful Logic to check the Switch Debounces.&lt;/P&gt;&lt;P&gt;if((buttonsPressed != 0))&lt;BR /&gt;{&lt;BR /&gt;/* Set FlexCAN TX value according to the button pressed */&lt;BR /&gt;switch (buttonsPressed)&lt;BR /&gt;{&lt;BR /&gt;case (1 &amp;lt;&amp;lt; BTN1_PIN):&lt;BR /&gt;/* Toggle output value LED1 */&lt;BR /&gt;PINS_DRV_TogglePins(GPIO_PORT, (1 &amp;lt;&amp;lt; LED1));&lt;BR /&gt;Int_flag_1 = 1;&lt;/P&gt;&lt;P&gt;/* Clear interrupt flag */&lt;BR /&gt;PINS_DRV_ClearPinIntFlagCmd(BTN_PORT, BTN1_PIN);&lt;BR /&gt;break;&lt;BR /&gt;case (1 &amp;lt;&amp;lt; BTN2_PIN):&lt;BR /&gt;/* Toggle output value LED2 */&lt;BR /&gt;PINS_DRV_TogglePins(GPIO_PORT, (1 &amp;lt;&amp;lt; LED2));&lt;BR /&gt;Int_flag_2 = 1;&lt;/P&gt;&lt;P&gt;/* Clear interrupt flag */&lt;BR /&gt;PINS_DRV_ClearPinIntFlagCmd(BTN_PORT, BTN2_PIN);&lt;BR /&gt;break;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 06:20:31 GMT</pubDate>
    <dc:creator>Dilip1441</dc:creator>
    <dc:date>2022-09-23T06:20:31Z</dc:date>
    <item>
      <title>buttonISR Issue</title>
      <link>https://community.nxp.com/t5/S32K/buttonISR-Issue/m-p/1527143#M17901</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm facing the issue with buttonISR, In my code i'm checking the Pin Pressed Status like below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uint32_t buttonsPressed = ((PINS_DRV_GetPortIntFlag(BTN_PORT_D) | PINS_DRV_GetPortIntFlag(BTN_PORT)) &amp;amp; ((1 &amp;lt;&amp;lt; BTN1_PIN) | (1 &amp;lt;&amp;lt; BTN2_PIN) | (1 &amp;lt;&amp;lt; BTN3_PIN) | (1 &amp;lt;&amp;lt; BTN4_PIN) | (1 &amp;lt;&amp;lt; BTN5_PIN) | (1 &amp;lt;&amp;lt; BTN6_PIN) | (1 &amp;lt;&amp;lt; BTN7_PIN)));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.If i add no.of pins then need to increase the no.of Pin Status check lines-&amp;gt;Pease give the Solution without increasing the Lines of code&amp;nbsp; to check the Pin Status.&lt;/P&gt;&lt;P&gt;2.The Above Logic for Pin Press Status check for 2 Port pins(Port C and Port D)-As per the Above logic it 'll works only there is a difference in the Selected Port Pins(Port C-1,2,3,4,5 and Port D-6,7,8,9,10 ), But It'll not work if i select the Same pins i Different Ports(Port C-1,2,3,4,5 and Port D-1,2,3,4,5)---Please give the Solution for this.&lt;/P&gt;&lt;P&gt;3.I'm Checking the Particular Pin is Pressed or not Status using the Switch case only like below,So it'll check Sequentially--Is there any option to check the Pin Status at a time Parallelly.&lt;/P&gt;&lt;P&gt;4.Is there any Predefined Function to Check the Debounce of the Switch, Please Provide the Debounce&lt;/P&gt;&lt;P&gt;Function or Useful Logic to check the Switch Debounces.&lt;/P&gt;&lt;P&gt;if((buttonsPressed != 0))&lt;BR /&gt;{&lt;BR /&gt;/* Set FlexCAN TX value according to the button pressed */&lt;BR /&gt;switch (buttonsPressed)&lt;BR /&gt;{&lt;BR /&gt;case (1 &amp;lt;&amp;lt; BTN1_PIN):&lt;BR /&gt;/* Toggle output value LED1 */&lt;BR /&gt;PINS_DRV_TogglePins(GPIO_PORT, (1 &amp;lt;&amp;lt; LED1));&lt;BR /&gt;Int_flag_1 = 1;&lt;/P&gt;&lt;P&gt;/* Clear interrupt flag */&lt;BR /&gt;PINS_DRV_ClearPinIntFlagCmd(BTN_PORT, BTN1_PIN);&lt;BR /&gt;break;&lt;BR /&gt;case (1 &amp;lt;&amp;lt; BTN2_PIN):&lt;BR /&gt;/* Toggle output value LED2 */&lt;BR /&gt;PINS_DRV_TogglePins(GPIO_PORT, (1 &amp;lt;&amp;lt; LED2));&lt;BR /&gt;Int_flag_2 = 1;&lt;/P&gt;&lt;P&gt;/* Clear interrupt flag */&lt;BR /&gt;PINS_DRV_ClearPinIntFlagCmd(BTN_PORT, BTN2_PIN);&lt;BR /&gt;break;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 06:20:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/buttonISR-Issue/m-p/1527143#M17901</guid>
      <dc:creator>Dilip1441</dc:creator>
      <dc:date>2022-09-23T06:20:31Z</dc:date>
    </item>
  </channel>
</rss>

