diff --git a/configs/bambino-200e/src/lpc43_buttons.c b/configs/bambino-200e/src/lpc43_buttons.c index 8f96dafd27..7985221aa2 100644 --- a/configs/bambino-200e/src/lpc43_buttons.c +++ b/configs/bambino-200e/src/lpc43_buttons.c @@ -61,7 +61,7 @@ * by the BUTTON_* definitions in board.h */ -static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttoncfg[NUM_BUTTONS] = { BAMBINO_BUT1 }; @@ -71,7 +71,7 @@ static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static uint8_t g_buttonirq[NUM_BUTTONS] = { BAMBINO_BUT1_IRQ }; @@ -98,7 +98,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc43_configgpio(g_buttoncfg[i]); } @@ -127,7 +127,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -172,7 +172,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Disable interrupts until we are done */ diff --git a/configs/lincoln60/src/lpc17_buttons.c b/configs/lincoln60/src/lpc17_buttons.c index 48ea429826..7a9981db8d 100644 --- a/configs/lincoln60/src/lpc17_buttons.c +++ b/configs/lincoln60/src/lpc17_buttons.c @@ -64,7 +64,7 @@ * the BUTTON_* and JOYSTICK_* definitions in board.h */ -static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttoncfg[NUM_BUTTONS] = { LINCOLN60_BUT1 }; @@ -74,7 +74,7 @@ static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static uint8_t g_buttonirq[NUM_BUTTONS] = { LINCOLN60_BUT1_IRQ }; @@ -105,7 +105,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc17_configgpio(g_buttoncfg[i]); } @@ -134,7 +134,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -179,7 +179,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Disable interrupts until we are done */ diff --git a/configs/lpc4330-xplorer/src/lpc43_buttons.c b/configs/lpc4330-xplorer/src/lpc43_buttons.c index 9e09ce07dc..4d44c59921 100644 --- a/configs/lpc4330-xplorer/src/lpc43_buttons.c +++ b/configs/lpc4330-xplorer/src/lpc43_buttons.c @@ -63,7 +63,7 @@ * by the BUTTON_* definitions in board.h */ -static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttoncfg[NUM_BUTTONS] = { LPC4330_XPLORER_BUT1 }; @@ -73,7 +73,7 @@ static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static uint8_t g_buttonirq[NUM_BUTTONS] = { LPC4330_XPLORER_BUT1_IRQ }; @@ -104,7 +104,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc43_configgpio(g_buttoncfg[i]); } @@ -133,7 +133,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -178,7 +178,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Disable interrupts until we are done */ diff --git a/configs/lpc4357-evb/src/lpc43_buttons.c b/configs/lpc4357-evb/src/lpc43_buttons.c index 2ed5097495..ab82b449e0 100644 --- a/configs/lpc4357-evb/src/lpc43_buttons.c +++ b/configs/lpc4357-evb/src/lpc43_buttons.c @@ -65,7 +65,7 @@ */ #if 0 /* Not yet used */ -static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttoncfg[NUM_BUTTONS] = { }; @@ -74,7 +74,7 @@ static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static uint8_t g_buttonirq[NUM_BUTTONS] = { }; #endif @@ -106,7 +106,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc43_configgpio(g_buttoncfg[i]); } @@ -137,7 +137,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -187,7 +187,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Disable interrupts until we are done */ diff --git a/configs/olimex-lpc1766stk/src/lpc17_buttons.c b/configs/olimex-lpc1766stk/src/lpc17_buttons.c index 179a678584..19e5830432 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_buttons.c +++ b/configs/olimex-lpc1766stk/src/lpc17_buttons.c @@ -64,7 +64,7 @@ * the BUTTON_* and JOYSTICK_* definitions in board.h */ -static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttoncfg[NUM_BUTTONS] = { LPC1766STK_BUT1, LPC1766STK_BUT2, LPC1766STK_WAKEUP, LPC1766STK_CENTER, LPC1766STK_UP, LPC1766STK_DOWN, LPC1766STK_LEFT, LPC1766STK_RIGHT @@ -75,7 +75,7 @@ static const uint16_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static uint8_t g_buttonirq[NUM_BUTTONS] = { LPC1766STK_BUT1_IRQ, LPC1766STK_BUT2_IRQ, LPC1766STK_WAKEUP_IRQ, LPC1766STK_CENTER_IRQ, LPC1766STK_UP_IRQ, LPC1766STK_DOWN_IRQ, @@ -108,7 +108,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc17_configgpio(g_buttoncfg[i]); } @@ -137,7 +137,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -182,7 +182,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Disable interrupts until we are done */ diff --git a/configs/open1788/src/lpc17_buttons.c b/configs/open1788/src/lpc17_buttons.c index 3aaf4a5e67..e35484bad6 100644 --- a/configs/open1788/src/lpc17_buttons.c +++ b/configs/open1788/src/lpc17_buttons.c @@ -81,7 +81,7 @@ * the BUTTON_* and JOYSTICK_* definitions in board.h */ -static const lpc17_pinset_t g_buttoncfg[BOARD_NUM_BUTTONS] = +static const lpc17_pinset_t g_buttoncfg[NUM_BUTTONS] = { GPIO_USER1, GPIO_USER2, GPIO_USER3, GPIO_JOY_A, GPIO_JOY_B, GPIO_JOY_C, GPIO_JOY_D, GPIO_JOY_CTR @@ -92,7 +92,7 @@ static const lpc17_pinset_t g_buttoncfg[BOARD_NUM_BUTTONS] = * numbers. */ -static const uint8_t g_buttonirq[BOARD_NUM_BUTTONS] = +static const uint8_t g_buttonirq[NUM_BUTTONS] = { 0, GPIO_USER2_IRQ, GPIO_USER3_IRQ, GPIO_JOY_A_IRQ, GPIO_JOY_B_IRQ, GPIO_JOY_C_IRQ, GPIO_JOY_D_IRQ, GPIO_JOY_CTR_IRQ @@ -120,7 +120,7 @@ void board_button_initialize(void) /* Configure the GPIO pins as interrupting inputs. */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc17_configgpio(g_buttoncfg[i]); } @@ -149,7 +149,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { /* A LOW value means that the key is pressed. */ @@ -196,7 +196,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) /* Verify that the button ID is within range */ - if ((unsigned)id < BOARD_NUM_BUTTONS) + if ((unsigned)id < NUM_BUTTONS) { /* Get the IRQ number for the button; A value of zero indicates that * the button does not support the interrupt function. diff --git a/configs/zkit-arm-1769/src/lpc17_buttons.c b/configs/zkit-arm-1769/src/lpc17_buttons.c index e93f27734f..0c0de7dedd 100644 --- a/configs/zkit-arm-1769/src/lpc17_buttons.c +++ b/configs/zkit-arm-1769/src/lpc17_buttons.c @@ -68,10 +68,10 @@ * Private Data ****************************************************************************/ /* Pin configuration for each zkit-arm-1769 button. This array is indexed by - * BOARD_NUM_BUTTONS in board.h + * NUM_BUTTONS in board.h */ -static const uint16_t g_buttons[BOARD_NUM_BUTTONS] = +static const uint16_t g_buttons[NUM_BUTTONS] = { ZKITARM_KEY1, ZKITARM_KEY2, ZKITARM_KEY3, ZKITARM_KEY4, ZKITARM_KEY5 }; @@ -99,7 +99,7 @@ void board_button_initialize(void) * configured for some pins but NOT used in this file */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { lpc17_configgpio(g_buttons[i]); } @@ -117,7 +117,7 @@ uint32_t board_buttons(void) /* Check that state of each key */ - for (i = 0; i < BOARD_NUM_BUTTONS; i++) + for (i = 0; i < NUM_BUTTONS; i++) { released = lpc17_gpioread(g_buttons[i]);