diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-06 11:07:53 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-06 11:07:53 -0600 |
commit | b6d1d101fc17a7627ca5cc88366fd7a1904bf74e (patch) | |
tree | bfaa13406f44c39949b0b0c4e2a46b00f2ebb2fb /nuttx/configs/freedom-kl25z | |
parent | e21898b25ae82d55bd2e80b86e3ad61c1ed56643 (diff) | |
download | px4-nuttx-b6d1d101fc17a7627ca5cc88366fd7a1904bf74e.tar.gz px4-nuttx-b6d1d101fc17a7627ca5cc88366fd7a1904bf74e.tar.bz2 px4-nuttx-b6d1d101fc17a7627ca5cc88366fd7a1904bf74e.zip |
Fixes LEDs on the Freedom KL25Z board
Diffstat (limited to 'nuttx/configs/freedom-kl25z')
-rw-r--r-- | nuttx/configs/freedom-kl25z/README.txt | 18 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/src/freedom-kl25z.h | 6 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/src/kl_led.c | 42 |
3 files changed, 41 insertions, 25 deletions
diff --git a/nuttx/configs/freedom-kl25z/README.txt b/nuttx/configs/freedom-kl25z/README.txt index 00bb4640b..5a278d3fa 100644 --- a/nuttx/configs/freedom-kl25z/README.txt +++ b/nuttx/configs/freedom-kl25z/README.txt @@ -88,15 +88,15 @@ LEDs SYMBOL Meaning LED state Initially all LED is OFF ------------------- ----------------------- -------------------------- - LED_STARTED NuttX has been started - LED_HEAPALLOCATE Heap has been allocated - LED_IRQSENABLED Interrupts enabled - LED_STACKCREATED Idle stack created - LED_INIRQ In an interrupt - LED_SIGNAL In a signal handler - LED_ASSERTION An assertion failed - LED_PANIC The system has crashed - LED_IDLE K25Z1XX is in sleep mode (Optional, not used) + LED_STARTED NuttX has been started R=OFF G=OFF B=OFF + LED_HEAPALLOCATE Heap has been allocated (no change) + LED_IRQSENABLED Interrupts enabled (no change) + LED_STACKCREATED Idle stack created R=OFF G=OFF B=ON + LED_INIRQ In an interrupt (no change) + LED_SIGNAL In a signal handler (no change) + LED_ASSERTION An assertion failed (no change) + LED_PANIC The system has crashed R=FLASHING G=OFF B=OFF + LED_IDLE K25Z1XX is in sleep mode (Optional, not used) Serial Console ============== diff --git a/nuttx/configs/freedom-kl25z/src/freedom-kl25z.h b/nuttx/configs/freedom-kl25z/src/freedom-kl25z.h index cc2f35a84..7638c4558 100644 --- a/nuttx/configs/freedom-kl25z/src/freedom-kl25z.h +++ b/nuttx/configs/freedom-kl25z/src/freedom-kl25z.h @@ -79,9 +79,9 @@ * LED_IDLE K25Z1XX is in sleep mode (Optional, not used) */ -#define GPIO_LED_R (GPIO_OUTPUT | PIN_PORTB | PIN18) -#define GPIO_LED_G (GPIO_OUTPUT | PIN_PORTB | PIN19) -#define GPIO_LED_B (GPIO_OUTPUT | PIN_PORTD | PIN1) +#define GPIO_LED_R (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTB | PIN18) +#define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTB | PIN19) +#define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN1) /* Button definitions ***************************************************************/ /* The Freedom KL25Z has no buttons */ diff --git a/nuttx/configs/freedom-kl25z/src/kl_led.c b/nuttx/configs/freedom-kl25z/src/kl_led.c index a71c56638..1d54be45c 100644 --- a/nuttx/configs/freedom-kl25z/src/kl_led.c +++ b/nuttx/configs/freedom-kl25z/src/kl_led.c @@ -1,6 +1,6 @@ /**************************************************************************** - * configs/freedom-kl25z/src/up_autoleds.c - * arch/arm/src/board/up_autoleds.c + * configs/freedom-kl25z/src/kl_led.c + * arch/arm/src/board/kl_led.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> @@ -48,15 +48,15 @@ * SYMBOL Meaning LED state * Initially all LED is OFF * ------------------- ----------------------- -------------------------- - * LED_STARTED NuttX has been started - * LED_HEAPALLOCATE Heap has been allocated - * LED_IRQSENABLED Interrupts enabled - * LED_STACKCREATED Idle stack created - * LED_INIRQ In an interrupt - * LED_SIGNAL In a signal handler - * LED_ASSERTION An assertion failed - * LED_PANIC The system has crashed - * LED_IDLE K25Z1XX is in sleep mode (Optional, not used) + * LED_STARTED NuttX has been started R=OFF G=OFF B=OFF + * LED_HEAPALLOCATE Heap has been allocated (no change) + * LED_IRQSENABLED Interrupts enabled (no change) + * LED_STACKCREATED Idle stack created R=OFF G=OFF B=ON + * LED_INIRQ In an interrupt (no change) + * LED_SIGNAL In a signal handler (no change) + * LED_ASSERTION An assertion failed (no change) + * LED_PANIC The system has crashed R=FLASHING G=OFF B=OFF + * LED_IDLE K25Z1XX is in sleep mode (Optional, not used) */ /**************************************************************************** @@ -138,7 +138,18 @@ void kl_ledinit(void) void up_ledon(int led) { - kl_gpiowrite(GPIO_LED_B, false); + if (led == LED_STACKCREATED) + { + kl_gpiowrite(GPIO_LED_R, true); + kl_gpiowrite(GPIO_LED_G, true); + kl_gpiowrite(GPIO_LED_B, false); + } + else if (led == LED_PANIC) + { + kl_gpiowrite(GPIO_LED_R, false); + kl_gpiowrite(GPIO_LED_G, true); + kl_gpiowrite(GPIO_LED_B, true); + } } /**************************************************************************** @@ -147,7 +158,12 @@ void up_ledon(int led) void up_ledoff(int led) { - kl_gpiowrite(GPIO_LED_B, true); + if (led == LED_PANIC) + { + kl_gpiowrite(GPIO_LED_R, true); + kl_gpiowrite(GPIO_LED_G, true); + kl_gpiowrite(GPIO_LED_B, true); + } } #endif /* CONFIG_ARCH_LEDS */ |