diff --git a/configs/nucleo-144/README.txt b/configs/nucleo-144/README.txt index e264413977..77ca0f0170 100644 --- a/configs/nucleo-144/README.txt +++ b/configs/nucleo-144/README.txt @@ -294,7 +294,7 @@ Configurations ============== nsh: ---------- +---- Configures the NuttShell (nsh) located at apps/examples/nsh for the Nucleo-144 boards. The Configuration enables the serial interfaces on UART6. Support for builtin applications is enabled, but in the base @@ -334,7 +334,7 @@ nsh: Consoles). evalos: ---------- +------- This configuration is designed to test the features of the board. - Configures the NuttShell (nsh) located at apps/examples/nsh for the Nucleo-144 boards. The console is available on serial interface USART3, diff --git a/configs/nucleo-144/src/stm32_appinitialize.c b/configs/nucleo-144/src/stm32_appinitialize.c index cbdae3906d..8dabb2bc4f 100644 --- a/configs/nucleo-144/src/stm32_appinitialize.c +++ b/configs/nucleo-144/src/stm32_appinitialize.c @@ -44,10 +44,6 @@ #include "nucleo-144.h" #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -64,13 +60,17 @@ int board_app_initialize(void) { +#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER) int ret; /* 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); - } - return 1; + { + syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret); + } +#endif + + return OK; } diff --git a/configs/nucleo-144/src/stm32_autoleds.c b/configs/nucleo-144/src/stm32_autoleds.c index 0e7a19d6ad..e9114391af 100644 --- a/configs/nucleo-144/src/stm32_autoleds.c +++ b/configs/nucleo-144/src/stm32_autoleds.c @@ -90,20 +90,20 @@ void board_autoled_on(int led) switch (led) { - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - break; /* Leave ledstate == true to turn OFF */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ + /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ + /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ + break; /* Leave ledstate == true to turn OFF */ default: - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ + /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ + /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ + return; /* Return to leave STATUS LED unchanged */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ - ledstate = true; /* Set ledstate == false to turn ON */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + ledstate = true; /* Set ledstate == false to turn ON */ break; } @@ -121,21 +121,21 @@ void board_autoled_off(int led) /* These should not happen and are ignored */ default: - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ + /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ + /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ /* These result in no-change */ - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ + /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ + /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ + return; /* Return to leave STATUS LED unchanged */ /* Turn STATUS LED off set driving the output high */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ stm32_gpiowrite(GPIO_LD1, false); break; } diff --git a/configs/nucleo-144/src/stm32_buttons.c b/configs/nucleo-144/src/stm32_buttons.c index 0421caeec7..54a7dafbfb 100644 --- a/configs/nucleo-144/src/stm32_buttons.c +++ b/configs/nucleo-144/src/stm32_buttons.c @@ -47,10 +47,6 @@ #ifdef CONFIG_ARCH_BUTTONS -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/nucleo-144/src/stm32_spi.c b/configs/nucleo-144/src/stm32_spi.c index d3b5e9160e..e31a63a11d 100644 --- a/configs/nucleo-144/src/stm32_spi.c +++ b/configs/nucleo-144/src/stm32_spi.c @@ -74,14 +74,6 @@ # define spivdbg(x...) #endif -/************************************************************************************ - * Private Data - ************************************************************************************/ - -/************************************************************************************ - * Private Functions - ************************************************************************************/ - /************************************************************************************ * Public Functions ************************************************************************************/ diff --git a/configs/nucleo-144/src/stm32_userleds.c b/configs/nucleo-144/src/stm32_userleds.c index 1a0b4a5cc2..4ec9f20947 100644 --- a/configs/nucleo-144/src/stm32_userleds.c +++ b/configs/nucleo-144/src/stm32_userleds.c @@ -69,6 +69,7 @@ /**************************************************************************** * Private Data ****************************************************************************/ + /* This array maps an LED number to GPIO pin configuration */ static const uint32_t g_ledcfg[3] = @@ -96,10 +97,11 @@ void board_userled_initialize(void) int i; /* Configure LED1-3 GPIOs for output */ + for (i = 0; i < 3; i++) - { - stm32_configgpio(g_ledcfg[i]); - } + { + stm32_configgpio(g_ledcfg[i]); + } } /**************************************************************************** @@ -134,11 +136,13 @@ void board_userled(int led, bool ledon) void board_userled_all(uint8_t ledset) { int i; + /* Configure LED1-3 GPIOs for output */ + for (i = 0; i < 3; i++) - { - stm32_gpiowrite(g_ledcfg[i], (ledset & (1 << i)) != 0); - } + { + stm32_gpiowrite(g_ledcfg[i], (ledset & (1 << i)) != 0); + } } #endif /* !CONFIG_ARCH_LEDS */