You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/03/02 18:08:48 UTC
[incubator-nuttx] branch master updated: imxrt: fix userled config in appinit
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new f5e4314 imxrt: fix userled config in appinit
f5e4314 is described below
commit f5e431483e2e5a9bb65c8f4ec1994ee05dfdb4d2
Author: Michael Mogenson <mi...@gmail.com>
AuthorDate: Wed Mar 2 10:21:34 2022 -0500
imxrt: fix userled config in appinit
The imxrt1064, imxrt1064, and teensy-4.x board configs would fail to
build when CONFIG_USERLED_LOWER was enabled, due to a missing header in
imxrt_appinit.c and an unset local define.
Verified a build succeds for the specified boards with the following
defconfig modifications:
# CONFIG_ARCH_LEDS is not set
CONFIG_USERLED=y
CONFIG_USERLED_LOWER=y
Tested the "leds" Led driver example on a Teensy 4.1.
---
boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c | 7 ++-----
boards/arm/imxrt/imxrt1064-evk/src/imxrt_appinit.c | 7 ++-----
boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c | 7 ++-----
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c
index bb07ed0..f74ba7e 100644
--- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c
+++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_appinit.c
@@ -27,13 +27,10 @@
#include <sys/types.h>
#include <nuttx/board.h>
+#include <nuttx/leds/userled.h>
#include "imxrt1060-evk.h"
-#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
-# define HAVE_LEDS 0
-#endif
-
#ifdef CONFIG_BOARDCTL
/****************************************************************************
@@ -67,7 +64,7 @@
int board_app_initialize(uintptr_t arg)
{
-#ifdef HAVE_LEDS
+#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
int ret;
diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_appinit.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_appinit.c
index 31f4398..2f0be85 100644
--- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_appinit.c
+++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_appinit.c
@@ -27,13 +27,10 @@
#include <sys/types.h>
#include <nuttx/board.h>
+#include <nuttx/leds/userled.h>
#include "imxrt1064-evk.h"
-#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
-# define HAVE_LEDS 0
-#endif
-
#ifdef CONFIG_BOARDCTL
/****************************************************************************
@@ -67,7 +64,7 @@
int board_app_initialize(uintptr_t arg)
{
-#ifdef HAVE_LEDS
+#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
int ret;
diff --git a/boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c b/boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c
index 97ba5d2..662cf19 100644
--- a/boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c
+++ b/boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c
@@ -28,13 +28,10 @@
#include <syslog.h>
#include <nuttx/board.h>
+#include <nuttx/leds/userled.h>
#include "teensy-4.h"
-#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
-# define HAVE_LEDS 0
-#endif
-
#ifdef CONFIG_BOARDCTL
/****************************************************************************
@@ -69,7 +66,7 @@
int board_app_initialize(uintptr_t arg)
{
int ret;
- #ifdef HAVE_LEDS
+#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
/* Register the LED driver */
ret = userled_lower_initialize(LED_DRIVER_PATH);