Clicker2-STM32: Fixes for a clean build

This commit is contained in:
Gregory Nutt 2017-03-22 10:02:26 -06:00
parent 571aad3cf1
commit 1f13b21f87
3 changed files with 21 additions and 10 deletions

View File

@ -393,6 +393,18 @@ extern "C"
* Public Function Prototypes * 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 #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -80,8 +80,7 @@
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static static void board_led1_on(int led)
static static void board_led1_on(int led)
{ {
bool ledon = false; bool ledon = false;
@ -104,7 +103,7 @@ static static void board_led1_on(int led)
stm32_gpiowrite(GPIO_LED1, ledon); stm32_gpiowrite(GPIO_LED1, ledon);
} }
static static void board_led2_on(int led) static void board_led2_on(int led)
{ {
bool ledon = false; bool ledon = false;
@ -173,12 +172,10 @@ static void board_led2_off(int led)
void board_autoled_initialize(void) void board_autoled_initialize(void)
{ {
/* Configure LED1-4 GPIOs for output */ /* Configure LED1-2 GPIOs for output */
stm32_configgpio(GPIO_LED1); stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2); stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
} }
/**************************************************************************** /****************************************************************************

View File

@ -83,14 +83,16 @@ uint8_t board_buttons(void)
{ {
uint8_t ret = 0; 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; ret |= BUTTON_T2_BIT;
} }
if (stm32_gpioread(g_buttons[GPIO_BTN_T2])) if (!stm32_gpioread(GPIO_BTN_T3))
{ {
ret |= BUTTON_T3_BIT; ret |= BUTTON_T3_BIT;
} }
@ -126,7 +128,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
uint32_t btncfg; uint32_t btncfg;
btncfg = (id == BUTTON_T2) ? GPIO_BTN_T2 : GPIO_BTN_T3; 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
#endif /* CONFIG_ARCH_BUTTONS */ #endif /* CONFIG_ARCH_BUTTONS */