diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-25 17:49:43 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-25 17:49:43 +0000 |
commit | 347fa8f13710529e0306c2d894e3ea4f05534918 (patch) | |
tree | 67c25d0d51af7e78da47d381dc524df98a10d6fa /nuttx/configs/z16f2800100zcog/src | |
parent | c93c3e4c38b095e65cfc374f1cfee094e141f0fb (diff) | |
download | px4-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/z16f2800100zcog/src')
-rw-r--r-- | nuttx/configs/z16f2800100zcog/src/z16f_leds.c | 60 |
1 files changed, 5 insertions, 55 deletions
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 */ |