This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Config ISR for button1 interrupt on CC2530DK

Hello, I am a student engineer,

I am using a developpement board CC2530DK and I am trying to configure interrupt on Button 1 (S1).

But the interrupt is always called  and I don't understand why.

To configure the interrupt, I am using this declaration:

 

digioConfig bouton=

 1, //port 1

2, //pin number 2

0x04, //bit mask for pin 2

HAL_DIGIO_INPUT, //input

1 //initial value
};

after in configuration, I am using these calls:

 if((halDigioIntClear(&bouton)||
     halDigioIntSetEdge(&bouton,HAL_DIGIO_INT_FALLING_EDGE)||
      halDigioIntConnect(&bouton,button_ISR)||                                                         // button_ISR is a routine interrupt
      halDigioIntEnable(&bouton)) == HAL_DIGIO_ERROR )
  {
      halLcdWriteLine(HAL_LCD_LINE_3,"Erreur Digio");
  }

void button_ISR()
{
  halDigioIntDisable(&bouton);
  halDigioIntClear(&bouton);

  flag=!flag;
 
  halDigioIntEnable(&bouton);
}

 

I don't find my problem, and interrupt is called without any button action.

Could someone help me ?