9
0
Fork 0

Add logic to control LED

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1763 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2009-05-08 13:24:57 +00:00
parent 2c7fa474cf
commit 1783edc673
4 changed files with 43 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 */