diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-04 16:22:00 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-04 16:22:00 +0000 |
commit | af7acc9b9fa7b530cde8ed8c9e10b726e0473c28 (patch) | |
tree | 86f4b77720246a9871687d6b2b3f70a965197e43 /nuttx/configs/nucleus2g/include | |
parent | 14cba9fc43059f43e3907e2a1fc942b8e2c318c6 (diff) | |
download | px4-nuttx-af7acc9b9fa7b530cde8ed8c9e10b726e0473c28.tar.gz px4-nuttx-af7acc9b9fa7b530cde8ed8c9e10b726e0473c28.tar.bz2 px4-nuttx-af7acc9b9fa7b530cde8ed8c9e10b726e0473c28.zip |
Fix LED control logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2773 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/nucleus2g/include')
-rwxr-xr-x | nuttx/configs/nucleus2g/include/board.h | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/nuttx/configs/nucleus2g/include/board.h b/nuttx/configs/nucleus2g/include/board.h index 11d793f9d..415bf1741 100755 --- a/nuttx/configs/nucleus2g/include/board.h +++ b/nuttx/configs/nucleus2g/include/board.h @@ -127,17 +127,24 @@ * In normal usage, the two LEDs on the Babel CAN board would show CAN status, but if * CONFIG_ARCH_LEDS is defined, these LEDs will be controlled as follows for NuttX * debug functionality (where NC means "No Change"). - * + * + * During the boot phases. LED1 and LED2 will show boot status. + */ /* LED1 LED2 HEARTBEAT */ #define LED_STARTED 0 /* OFF OFF OFF */ #define LED_HEAPALLOCATE 1 /* GREEN OFF OFF */ #define LED_IRQSENABLED 2 /* OFF GREEN OFF */ -#define LED_STACKCREATED 3 /* GREEN GREEN OFF */ +#define LED_STACKCREATED 3 /* OFF OFF OFF */ -#define LED_INIRQ 4 /* NC NC ON */ -#define LED_SIGNAL 5 /* NC RED NC */ -#define LED_ASSERTION 6 /* RED NC NC */ -#define LED_PANIC 7 /* RED RED NC (1Hz flashing) */ +/* After the system is booted, this logic will no longer use LEDs 1 and 2. They + * are available for use the application software using lpc17_led1() and lpc17_led2() + * (prototyped below) + */ + /* LED1 LED2 HEARTBEAT */ +#define LED_INIRQ 4 /* NC NC ON (momentary) */ +#define LED_SIGNAL 5 /* NC NC ON (momentary) */ +#define LED_ASSERTION 6 /* NC NC ON (momentary) */ +#define LED_PANIC 7 /* NC NC ON (1Hz flashing) */ /* Alternate pin selections *********************************************************/ /* UART1 -- Not connected */ @@ -175,10 +182,23 @@ #define GPIO_SSP1_SCK GPIO_SSP1_SCK_1 /************************************************************************************ - * Public Data + * Public Types ************************************************************************************/ #ifndef __ASSEMBLY__ +#ifdef CONFIG_ARCH_LEDS +enum lpc17_ledstate_e +{ + LPC17_LEDSTATE_OFF = 0, + LPC17_LEDSTATE_GREEN = 1, + LPC17_LEDSTATE_RED = 2, + LPC17_LEDSTATE_AMBER = (LPC17_LEDSTATE_GREEN|LPC17_LEDSTATE_RED), +}; +#endif + +/************************************************************************************ + * Public Data + ************************************************************************************/ #undef EXTERN #if defined(__cplusplus) @@ -203,6 +223,19 @@ extern "C" { EXTERN void lpc17_boardinitialize(void); +/************************************************************************************ + * Name: lpc17_led1 and 2 + * + * Description: + * Once the system has booted, these functions can be used to control LEDs 1 and 2 + * + ************************************************************************************/ + +#ifdef CONFIG_ARCH_LEDS +EXTERN void lpc17_led1(enum lpc17_ledstate_e state); +EXTERN void lpc17_led2(enum lpc17_ledstate_e state); +#endif + #undef EXTERN #if defined(__cplusplus) } |