现在我们自己定制的板子c2541,代码是基于官方给出的simpleBLEperipheral demo。需要修改外部按键对应的gpio,默认的是p0.0和p0.1 现在我改成了p1.2和p1.3,hal_key.c文件修改如下.当我按下键时,iar会提示
Possible IDATA stack overflow detected.引起这个的原因是什么?我下面的代码有问题还是?希望TI的员工或者遇到过类似情况的高手帮忙解答一下,感激不尽。
/* SW_1 is at P1.2 */
#define HAL_KEY_SW_1_PORT P1
#define HAL_KEY_SW_1_BIT BV(2)
#define HAL_KEY_SW_1_SEL P1SEL
#define HAL_KEY_SW_1_DIR P1DIR
/* SW_2 is at P1.3 */
#define HAL_KEY_SW_2_PORT P1
#define HAL_KEY_SW_2_BIT BV(3)
#define HAL_KEY_SW_2_SEL P1SEL
#define HAL_KEY_SW_2_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(2) /* P1IEN – P1.2 enable/disable bit */
#define HAL_KEY_SW_1_IENBIT BV(4) /* Mask bit for all of Port_1 */
#define HAL_KEY_SW_1_PXIFG P1IFG /* Interrupt flag at source */
#define HAL_KEY_SW_2_IEN IEN2 /* CPU interrupt mask register */
#define HAL_KEY_SW_2_ICTL P1IEN /* Port Interrupt Control register */
#define HAL_KEY_SW_2_ICTLBIT BV(3) /* P0IEN – P1.3 enable/disable bit */
#define HAL_KEY_SW_2_IENBIT BV(4) /* Mask bit for all of Port_1 */
#define HAL_KEY_SW_2_PXIFG P1IFG /* Interrupt flag at source */
#define HAL_KEY_SW_1_EDGEBIT BV(0)
Susan Yang:
堆栈溢出问题 ,可以通过Project > Options > General Options > Stack/Heap 修改