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/sam_autoleds.c | |
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/sam_autoleds.c')
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_autoleds.c | 14 |
1 files changed, 13 insertions, 1 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 } } |