源程序需做如下修改:
(若已修改则无需再改动)
board.h文件:
113~115行:
//#define BOARD_REV_A_VB
//#define BOARD_REV_A_EK
#define BOARD_REV_B_EK
改为:
//#define BOARD_REV_A_VB
#define BOARD_REV_A_EK
//#define BOARD_REV_B_EK
755~760行:
#ifdef BOARD_REV_A_EK
/** Push button #0 definition. Attributes = pull-up + debounce + interrupt on rising edge. */
#define PIN_PUSHBUTTON_1 {PIO_PD18, PIOD, ID_PIOD, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
/** Push button #1 definition. Attributes = pull-up + debounce + interrupt on falling edge. */
#define PIN_PUSHBUTTON_2 {PIO_PD19, PIOD, ID_PIOD, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
#endif
改为:
#ifdef BOARD_REV_A_EK
/** Push button #0 definition. Attributes = pull-up + debounce + interrupt on rising edge. */
#define PIN_PUSHBUTTON_1 {PIO_PB17, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
/** Push button #1 definition. Attributes = pull-up + debounce + interrupt on falling edge. */
#define PIN_PUSHBUTTON_2 {PIO_PC31, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
#endif
做以上修改后,则按下开发板上的按键K2,PC上的光标向左移动,按下开发板上的按键K3,PC上的光标向右移动。