Mostly costmetic changes from review of last PR

This commit is contained in:
Gregory Nutt
2016-05-20 07:44:56 -06:00
parent 9643f68256
commit 2d3e653996
6 changed files with 40 additions and 48 deletions
+2 -2
View File
@@ -294,7 +294,7 @@ Configurations
============== ==============
nsh: nsh:
--------- ----
Configures the NuttShell (nsh) located at apps/examples/nsh for the Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-144 boards. The Configuration enables the serial interfaces Nucleo-144 boards. The Configuration enables the serial interfaces
on UART6. Support for builtin applications is enabled, but in the base on UART6. Support for builtin applications is enabled, but in the base
@@ -334,7 +334,7 @@ nsh:
Consoles). Consoles).
evalos: evalos:
--------- -------
This configuration is designed to test the features of the board. This configuration is designed to test the features of the board.
- Configures the NuttShell (nsh) located at apps/examples/nsh for the - Configures the NuttShell (nsh) located at apps/examples/nsh for the
Nucleo-144 boards. The console is available on serial interface USART3, Nucleo-144 boards. The console is available on serial interface USART3,
+8 -8
View File
@@ -44,10 +44,6 @@
#include "nucleo-144.h" #include "nucleo-144.h"
#include <nuttx/leds/userled.h> #include <nuttx/leds/userled.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -64,13 +60,17 @@
int board_app_initialize(void) int board_app_initialize(void)
{ {
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
int ret; int ret;
/* Register the LED driver */ /* Register the LED driver */
ret = userled_lower_initialize(LED_DRIVER_PATH); ret = userled_lower_initialize(LED_DRIVER_PATH);
if (ret < 0) if (ret < 0)
{ {
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret); syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
} }
return 1; #endif
return OK;
} }
+20 -20
View File
@@ -90,20 +90,20 @@ void board_autoled_on(int led)
switch (led) switch (led)
{ {
case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */
/* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */
/* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */
break; /* Leave ledstate == true to turn OFF */ break; /* Leave ledstate == true to turn OFF */
default: default:
case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */
/* LED_SIGNAL: In a signal handler STATUS LED=N/C */ /* LED_SIGNAL: In a signal handler STATUS LED=N/C */
/* LED_ASSERTION: An assertion failed STATUS LED=N/C */ /* LED_ASSERTION: An assertion failed STATUS LED=N/C */
return; /* Return to leave STATUS LED unchanged */ return; /* Return to leave STATUS LED unchanged */
case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */
case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */
ledstate = true; /* Set ledstate == false to turn ON */ ledstate = true; /* Set ledstate == false to turn ON */
break; break;
} }
@@ -121,21 +121,21 @@ void board_autoled_off(int led)
/* These should not happen and are ignored */ /* These should not happen and are ignored */
default: default:
case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */
/* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */
/* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */
case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */
/* These result in no-change */ /* These result in no-change */
case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */
/* LED_SIGNAL: In a signal handler STATUS LED=N/C */ /* LED_SIGNAL: In a signal handler STATUS LED=N/C */
/* LED_ASSERTION: An assertion failed STATUS LED=N/C */ /* LED_ASSERTION: An assertion failed STATUS LED=N/C */
return; /* Return to leave STATUS LED unchanged */ return; /* Return to leave STATUS LED unchanged */
/* Turn STATUS LED off set driving the output high */ /* 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); stm32_gpiowrite(GPIO_LD1, false);
break; break;
} }
-4
View File
@@ -47,10 +47,6 @@
#ifdef CONFIG_ARCH_BUTTONS #ifdef CONFIG_ARCH_BUTTONS
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
-8
View File
@@ -74,14 +74,6 @@
# define spivdbg(x...) # define spivdbg(x...)
#endif #endif
/************************************************************************************
* Private Data
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************ /************************************************************************************
* Public Functions * Public Functions
************************************************************************************/ ************************************************************************************/
+10 -6
View File
@@ -69,6 +69,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static const uint32_t g_ledcfg[3] = static const uint32_t g_ledcfg[3] =
@@ -96,10 +97,11 @@ void board_userled_initialize(void)
int i; int i;
/* Configure LED1-3 GPIOs for output */ /* Configure LED1-3 GPIOs for output */
for (i = 0; i < 3; i++) 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) void board_userled_all(uint8_t ledset)
{ {
int i; int i;
/* Configure LED1-3 GPIOs for output */ /* Configure LED1-3 GPIOs for output */
for (i = 0; i < 3; i++) 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 */ #endif /* !CONFIG_ARCH_LEDS */