diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-08 13:24:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-08 13:24:57 +0000 |
commit | 637a7d82473a76f00af93d16c38624b4960e8575 (patch) | |
tree | 4b2d6dd746b89ae756002f954ad5ed9de5723545 /nuttx/configs | |
parent | 98ae724df2b6e89254fa77fb9be4ea3f1c17073b (diff) | |
download | px4-nuttx-637a7d82473a76f00af93d16c38624b4960e8575.tar.gz px4-nuttx-637a7d82473a76f00af93d16c38624b4960e8575.tar.bz2 px4-nuttx-637a7d82473a76f00af93d16c38624b4960e8575.zip |
Add logic to control LED
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1763 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/eagle100/README.txt | 2 | ||||
-rw-r--r-- | nuttx/configs/eagle100/include/board.h | 2 | ||||
-rw-r--r-- | nuttx/configs/eagle100/ostest/defconfig | 2 | ||||
-rw-r--r-- | nuttx/configs/eagle100/src/up_leds.c | 42 |
4 files changed, 43 insertions, 5 deletions
diff --git a/nuttx/configs/eagle100/README.txt b/nuttx/configs/eagle100/README.txt index 27a725cf9..eefd0e18a 100644 --- a/nuttx/configs/eagle100/README.txt +++ b/nuttx/configs/eagle100/README.txt @@ -94,6 +94,8 @@ Eagle100-specific Configuration Options CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100 Ethernet bootloader. + CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. + LM3S6818 specific device driver settings CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the diff --git a/nuttx/configs/eagle100/include/board.h b/nuttx/configs/eagle100/include/board.h index 855c01176..e08d7af83 100644 --- a/nuttx/configs/eagle100/include/board.h +++ b/nuttx/configs/eagle100/include/board.h @@ -55,7 +55,7 @@ /* LED definitions ******************************************************************/ -/* The Eagle-100 has only one user LED: Port A, Bit 6. Below are the mapping of this +/* The Eagle-100 has only one user LED: Port E, Bit 1. Below is the mapping of this * single LED. From this single LED, we can get the following information: * * OFF Steady: The system has failed to boot to the point of enabling interrupts diff --git a/nuttx/configs/eagle100/ostest/defconfig b/nuttx/configs/eagle100/ostest/defconfig index 658d90989..d88d1e924 100644 --- a/nuttx/configs/eagle100/ostest/defconfig +++ b/nuttx/configs/eagle100/ostest/defconfig @@ -56,6 +56,7 @@ # CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions # CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100 # Ethernet bootloader. +# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture. CONFIG_ARCH=arm CONFIG_ARCH_ARM=y CONFIG_ARCH_CHIP=lm3s @@ -69,6 +70,7 @@ CONFIG_DRAM_NUTTXENTRY=0x00002000 CONFIG_ARCH_INTERRUPTSTACK=n CONFIG_ARCH_STACKDUMP=y CONFIG_ARCH_BOOTLOADER=y +CONFIG_ARCH_LEDS=y # # LM3S6918 specific serial device driver settings diff --git a/nuttx/configs/eagle100/src/up_leds.c b/nuttx/configs/eagle100/src/up_leds.c index 4fff52f62..2b8dcfb6b 100644 --- a/nuttx/configs/eagle100/src/up_leds.c +++ b/nuttx/configs/eagle100/src/up_leds.c @@ -40,6 +40,11 @@ #include <nuttx/config.h> #include <sys/types.h> + +#include <arch/board/board.h> + +#include "chip.h" +#include "up_arch.h" #include "up_internal.h" /**************************************************************************** @@ -65,9 +70,9 @@ #ifdef CONFIG_ARCH_LEDS void up_ledinit(void) { - /* Configure Port A, Bit 6 as an output, initial value=OFF */ + /* Configure Port E, Bit 1 as an output, initial value=OFF */ -#warning "Missing Logic" + lm3s_configgpio(GPIO_DIR_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTE | 1); } /**************************************************************************** @@ -76,7 +81,21 @@ void up_ledinit(void) void up_ledon(int led) { -#warning "Missing Logic" + switch (led) + { + case LED_STARTED: + case LED_HEAPALLOCATE: + default: + break; + case LED_IRQSENABLED: + case LED_STACKCREATED: + case LED_INIRQ: + case LED_SIGNAL: + case LED_ASSERTION: + case LED_PANIC: + modifyreg32(LM3S_GPIOE_DATA, 0, (1 << 1)); + break; + } } /**************************************************************************** @@ -85,7 +104,22 @@ void up_ledon(int led) void up_ledoff(int led) { -#warning "Missing Logic" + switch (led) + { + case LED_IRQSENABLED: + case LED_STACKCREATED: + default: + break; + + case LED_STARTED: + case LED_HEAPALLOCATE: + case LED_INIRQ: + case LED_SIGNAL: + case LED_ASSERTION: + case LED_PANIC: + modifyreg32(LM3S_GPIOE_DATA, (1 << 1), 0); + break; + } } #endif /* CONFIG_ARCH_LEDS */ |