Initial vector handling logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1166 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-11-08 15:12:56 +00:00
parent 60290695c1
commit 3e529d1399
3 changed files with 57 additions and 17 deletions

View File

@ -55,18 +55,18 @@
/* LED definitions **********************************************************/
/* The SH1_LPEVB has no user controllable LEDs. These are provided only
* in the event that CONFIG_ARCH_LEDs is enabled.
/* The SH1_LPEVB only a single LED controlled by either port A, pin 15, or
* port B, pin 15 (selectable via JP8).
*/
#define LED_STARTED 0
#define LED_HEAPALLOCATE 1
#define LED_IRQSENABLED 2
#define LED_STACKCREATED 3
#define LED_INIRQ 4
#define LED_SIGNAL 5
#define LED_ASSERTION 6
#define LED_PANIC 7
#define LED_IRQSENABLED 1
#define LED_STACKCREATED 1
#define LED_INIRQ 0
#define LED_SIGNAL 0
#define LED_ASSERTION 0
#define LED_PANIC 1
/* Button definitions *******************************************************/

View File

@ -54,6 +54,7 @@ SECTIONS
. = 0x0a002400;
.text : {
_stext = ABSOLUTE(.);
*(.reset) /* Reset/IRQ code */
*(.text) /* Code */
*(.fixup)
*(.gnu.warning)

View File

@ -48,6 +48,15 @@
* Definitions
****************************************************************************/
/* The SH1_LPEVB only a single LED controlled by either port A, pin 15, or
* port B, pin 15 (selectable via JP8). In this file, we assume the portB
* setup.
*/
#define SH1_PBDR_LED 0x8000
#define SH1_PBIOR_LED 0x8000
#define SH1_PBCR2_LED 0xc000
/****************************************************************************
* Private Data
****************************************************************************/
@ -67,9 +76,25 @@
#ifdef CONFIG_ARCH_LEDS
void up_ledinit(void)
{
/* The SH1_LPEVB has no user controllable LEDs. This is provided only
* in the event that CONFIG_ARCH_LEDs is enabled.
*/
uint16 reg16;
/* Setup port B, pin 15 as an output */
reg16 = getreg(SH1_PFC_PBIOR);
reg16 |= SH1_PBIOR_LED;
putreg(reg16, SH1_PFC_PBIOR);
/* Setup port B, pin 15 as a normal I/O register */
reg16 = getreg(SH1_PFC_PBCR1);
reg16 &= ~SH1_PBCR2_LED;
putreg(reg16, SH1_PFC_PBCR1);
/* Turn the LED off */
reg16 = getreg(SH1_PORTB_DR);
reg16 &= ~SH1_PBDR_LED;
putreg(reg16, SH1_PORTB_DR);
}
/****************************************************************************
@ -78,9 +103,16 @@ void up_ledinit(void)
void up_ledon(int led)
{
/* The SH1_LPEVB has no user controllable LEDs. This is provided only
* in the event that CONFIG_ARCH_LEDs is enabled.
*/
uint16 reg16;
if (led)
{
/* Turn the LED on */
reg16 = getreg(SH1_PORTB_DR);
reg16 |= SH1_PBDR_LED;
putreg(reg16, SH1_PORTB_DR);
}
}
/****************************************************************************
@ -89,8 +121,15 @@ void up_ledon(int led)
void up_ledoff(int led)
{
/* The SH1_LPEVB has no user controllable LEDs. This is provided only
* in the event that CONFIG_ARCH_LEDs is enabled.
*/
uint16 reg16;
if (led)
{
/* Turn the LED off */
reg16 = getreg(SH1_PORTB_DR);
reg16 &= ~SH1_PBDR_LED;
putreg(reg16, SH1_PORTB_DR);
}
}
#endif /* CONFIG_ARCH_LEDS */