Add logic to control LED
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1763 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
bbcc0bfa4d
commit
53ed4b0916
@ -94,6 +94,8 @@ Eagle100-specific Configuration Options
|
|||||||
CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100
|
CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100
|
||||||
Ethernet bootloader.
|
Ethernet bootloader.
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||||
|
|
||||||
LM3S6818 specific device driver settings
|
LM3S6818 specific device driver settings
|
||||||
|
|
||||||
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* 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:
|
* 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
|
* OFF Steady: The system has failed to boot to the point of enabling interrupts
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||||
# CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100
|
# CONFIG_ARCH_BOOTLOADER - Configure to use the MicroMint Eagle-100
|
||||||
# Ethernet bootloader.
|
# Ethernet bootloader.
|
||||||
|
# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||||
CONFIG_ARCH=arm
|
CONFIG_ARCH=arm
|
||||||
CONFIG_ARCH_ARM=y
|
CONFIG_ARCH_ARM=y
|
||||||
CONFIG_ARCH_CHIP=lm3s
|
CONFIG_ARCH_CHIP=lm3s
|
||||||
@ -69,6 +70,7 @@ CONFIG_DRAM_NUTTXENTRY=0x00002000
|
|||||||
CONFIG_ARCH_INTERRUPTSTACK=n
|
CONFIG_ARCH_INTERRUPTSTACK=n
|
||||||
CONFIG_ARCH_STACKDUMP=y
|
CONFIG_ARCH_STACKDUMP=y
|
||||||
CONFIG_ARCH_BOOTLOADER=y
|
CONFIG_ARCH_BOOTLOADER=y
|
||||||
|
CONFIG_ARCH_LEDS=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# LM3S6918 specific serial device driver settings
|
# LM3S6918 specific serial device driver settings
|
||||||
|
@ -40,6 +40,11 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include "chip.h"
|
||||||
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -65,9 +70,9 @@
|
|||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
void up_ledinit(void)
|
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)
|
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)
|
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 */
|
#endif /* CONFIG_ARCH_LEDS */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user