summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-25 17:49:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-25 17:49:43 +0000
commit347fa8f13710529e0306c2d894e3ea4f05534918 (patch)
tree67c25d0d51af7e78da47d381dc524df98a10d6fa /nuttx/configs
parentc93c3e4c38b095e65cfc374f1cfee094e141f0fb (diff)
downloadpx4-nuttx-347fa8f13710529e0306c2d894e3ea4f05534918.tar.gz
px4-nuttx-347fa8f13710529e0306c2d894e3ea4f05534918.tar.bz2
px4-nuttx-347fa8f13710529e0306c2d894e3ea4f05534918.zip
Add z16f system exception handling logic.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@564 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r--nuttx/configs/z16f2800100zcog/include/board.h9
-rw-r--r--nuttx/configs/z16f2800100zcog/ostest/defconfig5
-rw-r--r--nuttx/configs/z16f2800100zcog/src/z16f_leds.c60
3 files changed, 14 insertions, 60 deletions
diff --git a/nuttx/configs/z16f2800100zcog/include/board.h b/nuttx/configs/z16f2800100zcog/include/board.h
index 492106abb..774ca92c1 100644
--- a/nuttx/configs/z16f2800100zcog/include/board.h
+++ b/nuttx/configs/z16f2800100zcog/include/board.h
@@ -57,10 +57,11 @@
#define LED_STARTED 0
#define LED_HEAPALLOCATE 1
#define LED_IRQSENABLED 2
-#define LED_IDLE 3
-#define LED_INIRQ 4
-#define LED_ASSERTION 5
-#define LED_PANIC 6
+#define LED_STACKCREATED 3
+#define LED_IDLE 4
+#define LED_INIRQ 5
+#define LED_ASSERTION 6
+#define LED_PANIC 7
/****************************************************************************
* Public Functions
diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig
index 20a1799df..9963672da 100644
--- a/nuttx/configs/z16f2800100zcog/ostest/defconfig
+++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig
@@ -47,7 +47,9 @@
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
# the board that supports the particular chip or SoC.
# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_BOARD_LOOPSPERMSEC - for delay loops
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
+# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to z16f.
#
CONFIG_ARCH=z16
CONFIG_ARCH_Z16=y
@@ -59,8 +61,9 @@ CONFIG_ARCH_CHIP_Z16F3211=n
CONFIG_ARCH_CHIP_Z16F6411=n
CONFIG_ARCH_BOARD=z16f2800100zcog
CONFIG_ARCH_BOARD_Z16F2800100ZCOG=y
+CONFIG_BOARD_LOOPSPERMSEC=1250
CONFIG_DRAM_SIZE=65536
-
+CONFIG_ARCH_LEDS=y
#
# Z16F specific device driver settings
#
diff --git a/nuttx/configs/z16f2800100zcog/src/z16f_leds.c b/nuttx/configs/z16f2800100zcog/src/z16f_leds.c
index 54175a9b5..49e47282e 100644
--- a/nuttx/configs/z16f2800100zcog/src/z16f_leds.c
+++ b/nuttx/configs/z16f2800100zcog/src/z16f_leds.c
@@ -47,6 +47,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <arch/board/board.h>
#include "up_internal.h"
/****************************************************************************
@@ -84,38 +85,10 @@ void up_ledinit(void)
void up_ledon(int led)
{
- ubyte paout = getreg8(Z16F_GPIOA_OUT) & 0xf8;
- switch (led)
+ if ((unsigned)led <= 7)
{
- case LED_STARTED:
- 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(((getreg8(Z16F_GPIOA_OUT) & 0xf8) | led), Z16F_GPIOA_OUT);
}
- putreg8(paout, Z16F_GPIOA_OUT);
}
/****************************************************************************
@@ -124,32 +97,9 @@ void up_ledon(int led)
void up_ledoff(int led)
{
- switch (led)
+ if (led >= 1)
{
- case LED_STARTED:
- 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;
+ up_ledon(led-1);
}
}
#endif /* CONFIG_ARCH_LEDS */