AnsweredAssumed Answered

EZKIT-21469 Push Button interrupt

Question asked by LordBIX on Feb 28, 2015
Latest reply on Jun 7, 2015 by LordBIX

Dears,

 

i am having a problem, that my pushbutton interrupt for DAI connected buttons are only called once. So its working one time

 

How i get the the interrupt back in the mode to be able to be triggered for input?

 

I have attached the code..

 

Thank you for your help!

 

  /* pin assignments in SRU_PIN3 (Group D) */

 

  SRU(LOW,DAI_PB19_I); /* assign pin buffer 19 low so it is an input */

  SRU(LOW,DAI_PB20_I); /* assign pin buffer 20 low so it is an input */

 

  /* route MISCA signals in SRU_EXT_MISCA (Group E) */

 

    SRU(DAI_PB19_O,MISCA1_I); /* route so that DAI pin buffer 19 connects to MISCA1 */

    SRU(DAI_PB20_O,MISCA2_I); /* route so that DAI pin buffer 20 connects to MISCA2 */

 

    /* pin buffer disable in SRU_PINEN0 (Group F) */

 

    SRU(LOW,PBEN19_I); /* assign pin 19 low so it is an input */

  SRU(LOW,PBEN20_I); /* assign pin 20 low so it is an input */

   

  /* unmask individual interrupts */

  (*pDAI_IRPTL_PRI) = (SRU_EXTMISCA1_INT | SRU_EXTMISCA2_INT);

 

  /* make sure interrupts latch on the rising edge */

    (*pDAI_IRPTL_RE) = (SRU_EXTMISCA1_INT | SRU_EXTMISCA2_INT);

    //(*pDAI_IRPTL_FE) = (SRU_EXTMISCA1_INT | SRU_EXTMISCA2_INT);

 

  /* setup the IRQ pins to use the pushbuttons */

  (*pSYSCTL) |= (IRQ1EN | IRQ2EN);

 

  sysreg_bit_set(sysreg_MODE2, (IRQ1E | IRQ2E) );

  sysreg_bit_clr(sysreg_IRPTL, (IRQ1I | IRQ2I) );

 

  /* enable IRQ interrupts and make DAI interrupts high priority */

  sysreg_bit_set(sysreg_IMASK, (IRQ1I | IRQ2I | DAIHI) );

 

  sysreg_bit_set(sysreg_MODE1, IRPTEN ); /* enable global interrupts */

 

  /* register the interrut handlers */

  interrupt(SIG_DAIH,SW10_SW11_DAI_handler);

  interrupt(SIG_IRQ1,SW8_IRQ1_handler);

    interrupt(SIG_IRQ2,SW9_IRQ2_handler); 

 

 

 

void SW10_SW11_DAI_handler(int sig_int)

{

  int iTest = 0; /* flag to indicate which button was pushed */

 

  /* read the latch register which also clears the latched interrupt */

  iTest = (*pDAI_IRPTL_H);

 

  bypass_IIR=!bypass_IIR;

 

  /* if sw10 */

  if(SRU_EXTMISCA1_INT == iTest)

  {

 

  // switch 10 code

// bypass_IIR=!bypass_IIR;

 

  }

 

  /* else if sw11 */

  else if(SRU_EXTMISCA2_INT == iTest)

  {

  // switch 11 code

// bypass_IIR=!bypass_IIR;

  }

 

}

Outcomes