summaryrefslogtreecommitdiff
path: root/nuttx/configs/sama5d3x-ek/src/sam_userleds.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-11 15:57:35 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-11 15:57:35 -0600
commit2a39a89e9dab62ae81f4e7363d14a21f3cdcaf76 (patch)
tree4ad992dad274556d6df588e90cb8d9033b8ec4b0 /nuttx/configs/sama5d3x-ek/src/sam_userleds.c
parent7ef215c9b360c6376cb7d67312aafc5593ec05a6 (diff)
downloadpx4-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_userleds.c')
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_userleds.c8
1 files changed, 7 insertions, 1 deletions
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 */