在协议栈里配置成自己的按键引脚需要修改三个地方:
(1)找到hal_key.c,将SW_6配置成P2_0
/* SW_6 is at P2.0 */
#define HAL_KEY_SW_6_PORT P2
#define HAL_KEY_SW_6_BIT BV(0)
#define HAL_KEY_SW_6_SEL P2SEL
#define HAL_KEY_SW_6_DIR P2DIR
/* edge interrupt */
#define HAL_KEY_SW_6_EDGEBIT BV(3)
#define HAL_KEY_SW_6_EDGE HAL_KEY_RISING_EDGE//HAL_KEY_FALLING_EDGE
/* SW_6 interrupts */
#define HAL_KEY_SW_6_IEN IEN2 /* CPU interrupt mask register */
#define HAL_KEY_SW_6_IENBIT BV(1) /* Mask bit for all of Port_2 */
#define HAL_KEY_SW_6_ICTL P2IEN /* Port Interrupt Control register */
#define HAL_KEY_SW_6_ICTLBIT BV(0) /*