diff --git a/demos/bsp/boards/ngx/board_ngx4330.c b/demos/bsp/boards/ngx/board_ngx4330.c index 79f9d78f..0709db2f 100644 --- a/demos/bsp/boards/ngx/board_ngx4330.c +++ b/demos/bsp/boards/ngx/board_ngx4330.c @@ -42,14 +42,29 @@ #define BOARD_UART_PORT LPC_USART0 -#define BOARD_MAX_LEDS 2 const static struct { uint8_t mux_port; uint8_t mux_pin; uint8_t gpio_port; uint8_t gpio_pin; -}leds[BOARD_MAX_LEDS] = { {2, 11, 1, 11}, {2, 12, 1,12} }; +}leds[] = { {2, 11, 1, 11}, {2, 12, 1,12} }; + +enum { + BOARD_MAX_LEDS = sizeof(leds) / sizeof(leds[0]) +}; + +const static struct { + uint8_t mux_port; + uint8_t mux_pin; + + uint8_t gpio_port; + uint8_t gpio_pin; +}buttons[] = { {0x02, 7, 0, 7 } }; + +enum { + BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0]) +}; void board_init(void) { @@ -73,6 +88,13 @@ void board_init(void) GPIO_SetDir(leds[i].gpio_port, BIT_(leds[i].gpio_pin), 1); // output } + //------------- BUTTONS -------------// + for(uint8_t i=0; i