mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
boards/leds: remove dependency on leds example for some boards
Userled register path shouldn't depend on LED example. This dependency is broken, kernel code should not depend on apps code. Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
@@ -42,12 +42,6 @@
|
||||
# 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 <nuttx/spi/spi_transfer.h>
|
||||
|
||||
#include "kinetis_spi.h"
|
||||
@@ -77,7 +71,7 @@ int k64_bringup(void)
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -38,12 +38,6 @@
|
||||
# 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 <nuttx/spi/spi.h>
|
||||
|
||||
#ifdef CONFIG_INPUT_BUTTONS
|
||||
@@ -77,7 +71,7 @@ int k66_bringup(void)
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -117,7 +117,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -117,7 +117,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -74,7 +74,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -113,7 +113,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -84,7 +84,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -72,7 +72,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -164,7 +164,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
|
||||
@@ -73,7 +73,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -75,7 +75,7 @@ int nrf52_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -58,7 +58,7 @@ int nrf53_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -196,7 +196,7 @@ int nrf53_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -109,7 +109,7 @@ int nrf91_bringup(void)
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(CONFIG_EXAMPLES_LEDS_DEVPATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -138,14 +138,6 @@
|
||||
# undef HAVE_LED_DRIVER
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LED_DRIVER
|
||||
# ifdef CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# define LED_DRIVER_PATH CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# else
|
||||
# define LED_DRIVER_PATH "/dev/userleds"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* PIC32CZ CA70 GPIO Pin Definitions ****************************************/
|
||||
|
||||
@@ -125,7 +125,7 @@ int sam_bringup(void)
|
||||
#ifdef HAVE_LED_DRIVER
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n",
|
||||
|
||||
@@ -233,7 +233,7 @@ int sam_bringup(void)
|
||||
#ifdef HAVE_LED_DRIVER
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n",
|
||||
|
||||
@@ -341,14 +341,6 @@
|
||||
# undef HAVE_LED_DRIVER
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LED_DRIVER
|
||||
# ifdef CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# define LED_DRIVER_PATH CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# else
|
||||
# define LED_DRIVER_PATH "/dev/userleds"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Check if the MRF24J40 is supported in this configuration */
|
||||
|
||||
#ifndef CONFIG_IEEE802154_MRF24J40
|
||||
|
||||
@@ -60,12 +60,6 @@
|
||||
# define HAVE_LEDS 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# define LED_DRIVER_PATH CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
#else
|
||||
# define LED_DRIVER_PATH "/dev/userleds"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -91,7 +85,7 @@ int stm32_bringup(void)
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
@@ -60,12 +60,6 @@
|
||||
# define HAVE_LEDS 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
# define LED_DRIVER_PATH CONFIG_EXAMPLES_LEDS_DEVPATH
|
||||
#else
|
||||
# define LED_DRIVER_PATH "/dev/userleds"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -91,7 +85,7 @@ int stm32_bringup(void)
|
||||
#ifdef HAVE_LEDS
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
|
||||
Reference in New Issue
Block a user