boards/arm/kinetis/freedom-k64f: Add userled support
- Enable userled driver integration for the Freedom-K64F board. - Verified functionality with the leds example app. Signed-off-by: trns1997 <trns1997@gmail.com>
This commit is contained in:
parent
c558047dc1
commit
45b90e82e5
2 changed files with 26 additions and 0 deletions
|
|
@ -45,6 +45,11 @@
|
|||
#define HAVE_AUTOMOUNTER 1
|
||||
#define HAVE_USBDEV 1
|
||||
|
||||
#undef HAVE_LEDS
|
||||
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
|
||||
# define HAVE_LEDS 1
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_KINETIS_RTC)
|
||||
#define HAVE_RTC_DRIVER 1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,6 +38,16 @@
|
|||
# include "kinetis_alarm.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERLED
|
||||
# include <nuttx/leds/userled.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# define LED_DRIVER_PATH CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
#else
|
||||
# define LED_DRIVER_PATH "/dev/userleds"
|
||||
#endif
|
||||
|
||||
#include "freedom-k64f.h"
|
||||
|
||||
#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE)
|
||||
|
|
@ -61,6 +71,17 @@ int k64_bringup(void)
|
|||
struct rtc_lowerhalf_s *lower;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROC
|
||||
/* Mount the proc filesystem */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue