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.

Interrupt on P1_0



I have a board with a input button on P1_0.

How do I setup the proper code to enable interrupt on that port ?

I have tried to change the parameters on hal_key.c to reflect this but I have been unsuccessful.

 

Here is my setup for hal_key.c:

 

#define HAL_KEY_RISING_EDGE   0

#define HAL_KEY_FALLING_EDGE  1

 

#define HAL_KEY_DEBOUNCE_VALUE  25

 

/* CPU port interrupt */

#define HAL_KEY_CPU_PORT_1_IF P1IF

 

/* SW_1 is at P0.0 */

#define HAL_KEY_SW_1_PORT   P1

#define HAL_KEY_SW_1_BIT    BV(0)

#define HAL_KEY_SW_1_SEL    P1SEL

#define HAL_KEY_SW_1_DIR    P1DIR

 

#define HAL_KEY_SW_1_IEN      IEN2  /* CPU interrupt mask register */

#define HAL_KEY_SW_1_ICTL     P1IEN /* Port Interrupt Control register */

#define HAL_KEY_SW_1_ICTLBIT  BV(0) /* P0IEN - P0.0 enable/disable bit */

#define HAL_KEY_SW_1_IENBIT   BV(4) /* Mask bit for all of Port_0 */

#define HAL_KEY_SW_1_PXIFG    P1IFG /* Interrupt flag at source */


#define HAL_KEY_SW_1_EDGEBIT  BV(0)

 

Thanks

 

Christian