summaryrefslogtreecommitdiff
path: root/nuttx/configs/eagle100/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-08 13:24:57 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-05-08 13:24:57 +0000
commit637a7d82473a76f00af93d16c38624b4960e8575 (patch)
tree4b2d6dd746b89ae756002f954ad5ed9de5723545 /nuttx/configs/eagle100/src
parent98ae724df2b6e89254fa77fb9be4ea3f1c17073b (diff)
downloadpx4-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/eagle100/src')
-rw-r--r--nuttx/configs/eagle100/src/up_leds.c42
1 files changed, 38 insertions, 4 deletions
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 */