diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-14 14:14:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-14 14:14:54 +0000 |
commit | ee2220174467b0e456446f5faaef1bd1660f786e (patch) | |
tree | 61937f54d7558e15f984b0450c2958e9ed45b5bd /nuttx/configs/vsn/src/leds.c | |
parent | 38121cceb67b2408c5aab1d3e9998accef0d83c8 (diff) | |
download | px4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.gz px4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.bz2 px4-nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.zip |
VSN/apps update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3378 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/vsn/src/leds.c')
-rw-r--r-- | nuttx/configs/vsn/src/leds.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nuttx/configs/vsn/src/leds.c b/nuttx/configs/vsn/src/leds.c index ef3c87144..c1cc1c573 100644 --- a/nuttx/configs/vsn/src/leds.c +++ b/nuttx/configs/vsn/src/leds.c @@ -43,13 +43,17 @@ #include <nuttx/config.h> +#include <arch/board/board.h> +#include <arch/stm32/irq.h> + #include <stdint.h> #include <stdbool.h> #include <debug.h> -#include <arch/board/board.h> +#include "up_arch.h" #include "vsn.h" + /**************************************************************************** * Definitions ****************************************************************************/ @@ -72,6 +76,8 @@ /**************************************************************************** * Private Data ****************************************************************************/ + +irqstate_t irqidle_mask; /**************************************************************************** * Private Functions @@ -101,7 +107,10 @@ void up_ledinit(void) void up_ledon(int led) { - if (led==LED_IDLE) stm32_gpiowrite(GPIO_LED, true); + if (led==LED_IDLE) { + irqidle_mask = irqsave(); + stm32_gpiowrite(GPIO_LED, true); + } } /**************************************************************************** @@ -110,7 +119,10 @@ void up_ledon(int led) void up_ledoff(int led) { - if (led==LED_IDLE) stm32_gpiowrite(GPIO_LED, false); + if (led==LED_IDLE) { + stm32_gpiowrite(GPIO_LED, false); + irqrestore(irqidle_mask); + } } #endif /* CONFIG_ARCH_LEDS */ |