configs/tm4c1294-launchpad/src/tm4c_bringup.c: Enables /dev/userleds for tm4c1294-launchpad by calling userled_lower_initialize() in tm4c_bringup().

This commit is contained in:
Nathan Hartman 2019-07-25 11:18:32 -06:00 committed by Gregory Nutt
parent 0a4c592a4b
commit 497db422c3
2 changed files with 23 additions and 0 deletions

View File

@ -111,6 +111,13 @@
#define GPIO_LED_D3 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTF | GPIO_PIN_4)
#define GPIO_LED_D4 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTF | GPIO_PIN_0)
/* Check if we have the LED driver */
#define HAVE_USERLED_DRIVER 1
#if !defined(CONFIG_USERLED) || !defined(CONFIG_USERLED_LOWER)
# undef HAVE_USERLED_DRIVER
#endif
/* Button definitions ***************************************************************/
/* There are four push buttons on the board. Two of them are user controllable.
* The others are RESET and WAKE

View File

@ -58,6 +58,10 @@
#include "tiva_qencoder.h"
#include "tm4c1294-launchpad.h"
#ifdef HAVE_USERLED_DRIVER
# include <nuttx/leds/userled.h>
#endif
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -358,6 +362,18 @@ int tm4c_bringup(void)
}
#endif
#ifdef HAVE_USERLED_DRIVER
/* Register the LED driver */
ret = userled_lower_initialize("/dev/userleds");
if (ret != OK)
{
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n",
ret);
return ret;
}
#endif
UNUSED(ret);
return OK;
}