在Ubuntu环境下,文件board-mx6q_sabresd.h文件添加定义如下:
MX6Q_PAD_EIM_D16__GPIO_3_16,
MX6Q_PAD_EIM_D21__GPIO_3_21,
在Ubuntu环境下,文件board-mx6q_sabresd.c文件添加定义如下:
#define SABRESD_GPIO_IN_D16 IMX_GPIO_NR(3,16)
#define SABRESD_GPIO_IN_D21 IMX_GPIO_NR(3,21)
static struct gpio_keys_button sabresd_buttons[] =
{
GPIO_BUTTON(SABRESD_GPIO_VOL_DOWN, KEY_LEFT, 1, "left", 0, 1),//KEY_HOME
GPIO_BUTTON(SABRESD_GPIO_VOL_UP, KEY_RIGHT, 1, "right", 0, 1),
GPIO_BUTTON(SABRESD_GPIO_POWER, KEY_POWER, 1, "power", 1, 1),
GPIO_BUTTON(SABRESD_GPIO_IN_D16, KEY_D16, 1, "IN_D16", 0, 1),
GPIO_BUTTON(SABRESD_GPIO_IN_D21, KEY_D21, 1, "IN_D21", 0, 1),
};
编译时提示
arch/arm/mach-mx6/board-mx6q_sabresd.c:986:2: error: 'KEY_D16' undeclared here (not in a function)
arch/arm/mach-mx6/board-mx6q_sabresd.c:987:2: error: 'KEY_D21' undeclared here (not in a function)
是不是还有什么文件需要修改?怎么读取其输入值? |