diff --git a/configs/clicker2-stm32/include/board.h b/configs/clicker2-stm32/include/board.h index 967f601fa9..bb03e08699 100644 --- a/configs/clicker2-stm32/include/board.h +++ b/configs/clicker2-stm32/include/board.h @@ -393,6 +393,18 @@ extern "C" * Public Function Prototypes ************************************************************************************/ +/************************************************************************************ + * Name: stm32_boardinitialize + * + * Description: + * All STM32 architectures must provide the following entry point. This entry point + * is called early in the intitialization -- after all memory has been configured + * and mapped but before any devices have been initialized. + * + ************************************************************************************/ + +void stm32_boardinitialize(void); + #undef EXTERN #if defined(__cplusplus) } diff --git a/configs/clicker2-stm32/src/stm32_autoleds.c b/configs/clicker2-stm32/src/stm32_autoleds.c index e559c60efc..9b55bb4c2e 100644 --- a/configs/clicker2-stm32/src/stm32_autoleds.c +++ b/configs/clicker2-stm32/src/stm32_autoleds.c @@ -80,8 +80,7 @@ * Private Functions ****************************************************************************/ -static -static static void board_led1_on(int led) +static void board_led1_on(int led) { bool ledon = false; @@ -104,7 +103,7 @@ static static void board_led1_on(int led) stm32_gpiowrite(GPIO_LED1, ledon); } -static static void board_led2_on(int led) +static void board_led2_on(int led) { bool ledon = false; @@ -173,12 +172,10 @@ static void board_led2_off(int led) void board_autoled_initialize(void) { - /* Configure LED1-4 GPIOs for output */ + /* Configure LED1-2 GPIOs for output */ stm32_configgpio(GPIO_LED1); stm32_configgpio(GPIO_LED2); - stm32_configgpio(GPIO_LED3); - stm32_configgpio(GPIO_LED4); } /**************************************************************************** diff --git a/configs/clicker2-stm32/src/stm32_buttons.c b/configs/clicker2-stm32/src/stm32_buttons.c index 6ef612ce6d..14da26b964 100644 --- a/configs/clicker2-stm32/src/stm32_buttons.c +++ b/configs/clicker2-stm32/src/stm32_buttons.c @@ -83,14 +83,16 @@ uint8_t board_buttons(void) { uint8_t ret = 0; - /* Check that state of each key */ + /* Check that state of each key. A low value will be sensed when the + * button is pressed. + */ - if (!stm32_gpioread(g_buttons[GPIO_BTN_T2])) + if (!stm32_gpioread(GPIO_BTN_T2)) { ret |= BUTTON_T2_BIT; } - if (stm32_gpioread(g_buttons[GPIO_BTN_T2])) + if (!stm32_gpioread(GPIO_BTN_T3)) { ret |= BUTTON_T3_BIT; } @@ -126,7 +128,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) uint32_t btncfg; btncfg = (id == BUTTON_T2) ? GPIO_BTN_T2 : GPIO_BTN_T3; - return stm32_gpiosetevent(g_buttons[id], true, true, true, irqhandler, arg); + return stm32_gpiosetevent(btncfg, true, true, true, irqhandler, arg); } #endif #endif /* CONFIG_ARCH_BUTTONS */