From 53db5c80f315dc395505e88654f93ea63ca87457 Mon Sep 17 00:00:00 2001 From: Fanda Date: Tue, 16 Jan 2018 23:33:58 +0000 Subject: [PATCH] Merged in fvacek/nuttx (pull request #572) Fixed nucleo-l432kc broken build when CONFIG_USERLED_LOWER defined Approved-by: Gregory Nutt --- configs/nucleo-l432kc/include/board.h | 2 ++ configs/nucleo-l432kc/src/nucleo-l432kc.h | 1 + configs/nucleo-l432kc/src/stm32_appinit.c | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/configs/nucleo-l432kc/include/board.h b/configs/nucleo-l432kc/include/board.h index cbec4b9c37a..dbe6dbe48fa 100644 --- a/configs/nucleo-l432kc/include/board.h +++ b/configs/nucleo-l432kc/include/board.h @@ -45,7 +45,9 @@ # include #endif +#ifdef __KERNEL__ #include +#endif /************************************************************************************ * Pre-processor Definitions diff --git a/configs/nucleo-l432kc/src/nucleo-l432kc.h b/configs/nucleo-l432kc/src/nucleo-l432kc.h index a9ce4bee647..9ce05bc83d3 100644 --- a/configs/nucleo-l432kc/src/nucleo-l432kc.h +++ b/configs/nucleo-l432kc/src/nucleo-l432kc.h @@ -87,6 +87,7 @@ #define GPIO_LD2 \ (GPIO_PORTA | GPIO_PIN5 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_PULLUP | \ GPIO_SPEED_50MHz) +#define LED_DRIVER_PATH "/dev/userleds" /* Buttons * diff --git a/configs/nucleo-l432kc/src/stm32_appinit.c b/configs/nucleo-l432kc/src/stm32_appinit.c index 0422e0cf20c..d3a725c776a 100644 --- a/configs/nucleo-l432kc/src/stm32_appinit.c +++ b/configs/nucleo-l432kc/src/stm32_appinit.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER) + /* 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); + } +#endif + #ifdef HAVE_RTC_DRIVER /* Instantiate the STM32L4 lower-half RTC driver */