Olimex STM32 P407: Add button support

This commit is contained in:
Gregory Nutt 2017-02-28 08:31:57 -06:00
parent c62180732e
commit 92d65294fb
3 changed files with 13 additions and 10 deletions

View File

@ -45,8 +45,6 @@
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
#include "stm32_rcc.h"
#include "stm32.h"
/************************************************************************************
* Pre-processor Definitions

View File

@ -47,6 +47,7 @@
#include <nuttx/board.h>
#include <nuttx/mmcsd.h>
#include <nuttx/input/buttons.h>
#ifdef CONFIG_USBMONITOR
# include <nuttx/usb/usbmonitor.h>
@ -169,6 +170,16 @@ int stm32_bringup(void)
}
#endif
#ifdef CONFIG_BUTTONS
/* Register the BUTTON driver */
ret = btn_lower_initialize("/dev/buttons");
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: btn_lower_initialize() failed: %d\n", ret);
}
#endif
UNUSED(ret);
return OK;
}

View File

@ -45,18 +45,12 @@
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "stm32_gpio.h"
#include "olimex-stm32-p407.h"
#ifdef CONFIG_ARCH_BUTTONS
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/