Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions boards/arm/stm32f7/stm32f746g-disco/src/stm32_bringup.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
# include <nuttx/video/fb.h>
#endif

#if defined(CONFIG_USERLED_LOWER) && !defined(CONFIG_ARCH_LEDS)
# include <nuttx/leds/userled.h>
#endif

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -150,6 +154,14 @@ int stm32_bringup(void)
}
#endif

#if defined(CONFIG_USERLED_LOWER) && !defined(CONFIG_ARCH_LEDS)
ret = userled_lower_initialize("/dev/led0");
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
}
#endif

UNUSED(ret); /* May not be used */
return OK;
}
7 changes: 4 additions & 3 deletions boards/arm/stm32f7/stm32f746g-disco/src/stm32_userleds.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************/

#include <nuttx/config.h>
#include <arch/board/board.h>

#include <stdbool.h>
#include <nuttx/debug.h>
Expand Down Expand Up @@ -67,9 +68,9 @@ uint32_t board_userled_initialize(void)

void board_userled(int led, bool ledon)
{
if (led == BOARD_STATUS_LED)
if (led == BOARD_LED1)
{
stm32_gpiowrite(GPIO_LD1, !ledon);
stm32_gpiowrite(GPIO_LD1, ledon);
}
}

Expand All @@ -86,7 +87,7 @@ void board_userled(int led, bool ledon)

void board_userled_all(uint32_t ledset)
{
stm32_gpiowrite(GPIO_LD1, (ledset & BOARD_STATUS_LED_BIT) != 0);
stm32_gpiowrite(GPIO_LD1, (ledset & BOARD_LED1_BIT) != 0);
}

#endif /* !CONFIG_ARCH_LEDS */
Loading