From 33e9f0c4422c511ab5db2e9d6743c1d03c3ab38e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 19 May 2009 15:17:28 +0000 Subject: Fix heap setup problem git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1793 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/eagle100/src/up_leds.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'nuttx/configs/eagle100/src/up_leds.c') diff --git a/nuttx/configs/eagle100/src/up_leds.c b/nuttx/configs/eagle100/src/up_leds.c index 43c9e8e70..5a9d36382 100644 --- a/nuttx/configs/eagle100/src/up_leds.c +++ b/nuttx/configs/eagle100/src/up_leds.c @@ -64,6 +64,8 @@ * Public Functions ****************************************************************************/ +static boolean g_nest; + /**************************************************************************** * Name: up_ledinit ****************************************************************************/ @@ -78,6 +80,7 @@ void up_ledinit(void) /* Configure Port E, Bit 1 as an output, initial value=OFF */ lm3s_configgpio(GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTE | 1); + g_nest = 0; } /**************************************************************************** @@ -92,12 +95,14 @@ void up_ledon(int led) case LED_HEAPALLOCATE: default: break; - case LED_IRQSENABLED: - case LED_STACKCREATED: + case LED_INIRQ: case LED_SIGNAL: case LED_ASSERTION: case LED_PANIC: + g_nest++; + case LED_IRQSENABLED: + case LED_STACKCREATED: modifyreg32(LM3S_GPIOE_DATA, 0, (1 << 1)); break; } @@ -113,16 +118,19 @@ void up_ledoff(int led) { case LED_IRQSENABLED: case LED_STACKCREATED: + case LED_STARTED: + case LED_HEAPALLOCATE: 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); + if (--g_nest <= 0) + { + modifyreg32(LM3S_GPIOE_DATA, (1 << 1), 0); + } break; } } -- cgit v1.2.3