diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-11 15:57:35 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-11 15:57:35 -0600 |
commit | 2a39a89e9dab62ae81f4e7363d14a21f3cdcaf76 (patch) | |
tree | 4ad992dad274556d6df588e90cb8d9033b8ec4b0 /nuttx/configs/sama5d3x-ek/src | |
parent | 7ef215c9b360c6376cb7d67312aafc5593ec05a6 (diff) | |
download | px4-nuttx-2a39a89e9dab62ae81f4e7363d14a21f3cdcaf76.tar.gz px4-nuttx-2a39a89e9dab62ae81f4e7363d14a21f3cdcaf76.tar.bz2 px4-nuttx-2a39a89e9dab62ae81f4e7363d14a21f3cdcaf76.zip |
SAMA5: The PIO used for the red LED is also used as the camera module reset line: Added a configuration option to suppress use of the red LED if the PIO is used for another purpose. Reported by David Sidrane.
Diffstat (limited to 'nuttx/configs/sama5d3x-ek/src')
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_autoleds.c | 14 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_userleds.c | 8 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h | 11 |
3 files changed, 29 insertions, 4 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c b/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c index ef255f4d3..3157511b5 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_autoleds.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/sama5d3x-ek/src/sam_autoleds.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -123,7 +123,9 @@ void board_led_initialize(void) /* Configure LED PIOs for output */ sam_configpio(PIO_BLUE); +#ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_configpio(PIO_RED); +#endif } /**************************************************************************** @@ -133,7 +135,9 @@ void board_led_initialize(void) void board_led_on(int led) { bool blueoff = true; /* Low illuminates */ +#ifndef CONFIG_SAMA5D3xEK_NOREDLED bool redon = false; /* High illuminates */ +#endif switch (led) { @@ -149,12 +153,18 @@ void board_led_on(int led) return; case 3: /* LED_PANIC */ +#ifdef CONFIG_SAMA5D3xEK_NOREDLED + blueoff = false; +#else redon = true; +#endif break; } sam_piowrite(PIO_BLUE, blueoff); +#ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_piowrite(PIO_RED, redon); +#endif } /**************************************************************************** @@ -166,7 +176,9 @@ void board_led_off(int led) if (led != 2) { sam_piowrite(PIO_BLUE, true); /* Low illuminates */ +#ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_piowrite(PIO_RED, false); /* High illuminates */ +#endif } } diff --git a/nuttx/configs/sama5d3x-ek/src/sam_userleds.c b/nuttx/configs/sama5d3x-ek/src/sam_userleds.c index 8adbd6ee3..690d10990 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_userleds.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_userleds.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/sama5d3x-ek/src/sam_userleds.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -108,7 +108,9 @@ void sam_ledinit(void) /* Configure LED PIOs for output */ sam_configpio(PIO_BLUE); +#ifndef CONFIG_SAMA5D3xEK_NOREDLED sam_configpio(PIO_RED); +#endif } /**************************************************************************** @@ -126,12 +128,14 @@ void sam_setled(int led, bool ledon) ledcfg = PIO_BLUE; ledon = !ledon; } +#ifndef CONFIG_SAMA5D3xEK_NOREDLED else if (led == BOARD_RED) { /* High illuminates */ ledcfg = PIO_RED; } +#endif else { return; @@ -153,10 +157,12 @@ void sam_setleds(uint8_t ledset) ledon = ((ledset & BOARD_BLUE_BIT) == 0); sam_piowrite(PIO_BLUE, ledon); +#ifndef CONFIG_SAMA5D3xEK_NOREDLED /* High illuminates */ ledon = ((ledset & BOARD_RED_BIT) != 0); sam_piowrite(PIO_RED, ledon); +#endif } #endif /* !CONFIG_ARCH_LEDS */ diff --git a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h index a5611f7ed..d41e169d9 100644 --- a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h +++ b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h @@ -1,7 +1,7 @@ /************************************************************************************ * configs/sama5d3x-ek/src/sama5d3x-ek.h * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -349,12 +349,19 @@ * that it is illuminated when power is applied even if PE24 is not * configured as an output. If PE24 is configured as an output, then the * LCD is illuminated by a high output. + * + * N.B. PE24 Drives the RED Led on the CM (SODIMM200), but unfortunately + * it is also connected to ISI_RST on the MB (Main Board) and controlling + * it will reset a Camera connected to the ISI */ #define PIO_BLUE (PIO_OUTPUT | PIO_CFG_PULLUP | PIO_OUTPUT_SET | \ PIO_PORT_PIOE | PIO_PIN25) -#define PIO_RED (PIO_OUTPUT | PIO_CFG_PULLUP | PIO_OUTPUT_CLEAR | \ + +#ifndef CONFIG_SAMA5D3xEK_NOREDLED +# define PIO_RED (PIO_OUTPUT | PIO_CFG_PULLUP | PIO_OUTPUT_CLEAR | \ PIO_PORT_PIOE | PIO_PIN24) +#endif /* Buttons **************************************************************************/ /* There are five push button switches on the SAMA5D3X-EK base board: |