Add z16f system exception handling logic.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@564 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
cb274ba442
commit
31f99a1041
@ -57,10 +57,11 @@
|
|||||||
#define LED_STARTED 0
|
#define LED_STARTED 0
|
||||||
#define LED_HEAPALLOCATE 1
|
#define LED_HEAPALLOCATE 1
|
||||||
#define LED_IRQSENABLED 2
|
#define LED_IRQSENABLED 2
|
||||||
#define LED_IDLE 3
|
#define LED_STACKCREATED 3
|
||||||
#define LED_INIRQ 4
|
#define LED_IDLE 4
|
||||||
#define LED_ASSERTION 5
|
#define LED_INIRQ 5
|
||||||
#define LED_PANIC 6
|
#define LED_ASSERTION 6
|
||||||
|
#define LED_PANIC 7
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
|
@ -47,7 +47,9 @@
|
|||||||
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
|
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
|
||||||
# the board that supports the particular chip or SoC.
|
# the board that supports the particular chip or SoC.
|
||||||
# CONFIG_ARCH_BOARD_name - for use in C code
|
# CONFIG_ARCH_BOARD_name - for use in C code
|
||||||
|
# CONFIG_BOARD_LOOPSPERMSEC - for delay loops
|
||||||
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
|
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
|
||||||
|
# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to z16f.
|
||||||
#
|
#
|
||||||
CONFIG_ARCH=z16
|
CONFIG_ARCH=z16
|
||||||
CONFIG_ARCH_Z16=y
|
CONFIG_ARCH_Z16=y
|
||||||
@ -59,8 +61,9 @@ CONFIG_ARCH_CHIP_Z16F3211=n
|
|||||||
CONFIG_ARCH_CHIP_Z16F6411=n
|
CONFIG_ARCH_CHIP_Z16F6411=n
|
||||||
CONFIG_ARCH_BOARD=z16f2800100zcog
|
CONFIG_ARCH_BOARD=z16f2800100zcog
|
||||||
CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y
|
CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y
|
||||||
|
CONFIG_BOARD_LOOPSPERMSEC=1250
|
||||||
CONFIG_DRAM_SIZE=65536
|
CONFIG_DRAM_SIZE=65536
|
||||||
|
CONFIG_ARCH_LEDS=y
|
||||||
#
|
#
|
||||||
# Z16F specific device driver settings
|
# Z16F specific device driver settings
|
||||||
#
|
#
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <arch/board/board.h>
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -84,38 +85,10 @@ void up_ledinit(void)
|
|||||||
|
|
||||||
void up_ledon(int led)
|
void up_ledon(int led)
|
||||||
{
|
{
|
||||||
ubyte paout = getreg8(Z16F_GPIOA_OUT) & 0xf8;
|
if ((unsigned)led <= 7)
|
||||||
switch (led)
|
|
||||||
{
|
{
|
||||||
case LED_STARTED:
|
putreg8(((getreg8(Z16F_GPIOA_OUT) & 0xf8) | led), Z16F_GPIOA_OUT);
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_HEAPALLOCATE:
|
|
||||||
paout |= 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_IRQSENABLED:
|
|
||||||
paout |= 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_IDLE:
|
|
||||||
paout |= 3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_INIRQ:
|
|
||||||
paout |= 4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_ASSERTION :
|
|
||||||
paout |= 5;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_PANIC:
|
|
||||||
default:
|
|
||||||
paout |= 6;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
putreg8(paout, Z16F_GPIOA_OUT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -124,32 +97,9 @@ void up_ledon(int led)
|
|||||||
|
|
||||||
void up_ledoff(int led)
|
void up_ledoff(int led)
|
||||||
{
|
{
|
||||||
switch (led)
|
if (led >= 1)
|
||||||
{
|
{
|
||||||
case LED_STARTED:
|
up_ledon(led-1);
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_HEAPALLOCATE:
|
|
||||||
up_ledoff(LED_STARTED);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_IRQSENABLED:
|
|
||||||
up_ledoff(LED_IRQSENABLED);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_IDLE:
|
|
||||||
up_ledoff(LED_IRQSENABLED);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_INIRQ:
|
|
||||||
case LED_ASSERTION :
|
|
||||||
up_ledoff(LED_IDLE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LED_PANIC:
|
|
||||||
default:
|
|
||||||
up_ledoff(LED_ASSERTION);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_ARCH_LEDS */
|
#endif /* CONFIG_ARCH_LEDS */
|
||||||
|
Loading…
Reference in New Issue
Block a user