summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-06-06 16:21:34 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-06-06 16:21:34 +0000
commit12e2b7ff0f87e446a7d7e4cf2ed5206e4246e49e (patch)
tree7be94f52510c499671cc2e4b13a64b3410ed4c06 /nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c
parent8bd428e3c88f0f756ee639d9a1004084e70a1c53 (diff)
downloadpx4-nuttx-12e2b7ff0f87e446a7d7e4cf2ed5206e4246e49e.tar.gz
px4-nuttx-12e2b7ff0f87e446a7d7e4cf2ed5206e4246e49e.tar.bz2
px4-nuttx-12e2b7ff0f87e446a7d7e4cf2ed5206e4246e49e.zip
Add GPIO debug logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2731 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c')
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_gpio.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c
index 2ee38de63..bc62a87ba 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c
@@ -73,8 +73,8 @@
*/
#ifdef CONFIG_GPIO_IRQ
-static uint32_t g_intedge0[2];
-static uint32_t g_intedge2[2];
+static uint64_t g_intedge0;
+static uint64_t g_intedge2;
#endif
/****************************************************************************
@@ -278,35 +278,28 @@ static int lpc17_pullup(uint16_t cfgset, unsigned int port, unsigned int pin)
#ifdef CONFIG_GPIO_IRQ
static int lpc17_setintedge(unsigned int port, unsigned int pin, unsigned int value)
{
- const uint32_t *table;
- uint32_t tabval;
+ const uint64_t *intedge;
unsigned int shift;
/* Which word to we use? */
if (port == 0)
{
- table = g_intedge0;
+ intedge = g_intedge0;
}
else if (port == 2)
{
- table = g_intedge2;
+ intedge = g_intedge2;
}
else
{
return;
}
- if (pin >= 16)
- {
- table++;
- pin -= 16;
- }
-
/* Set the requested value in the PINSEL register */
- *table &= ~(3 << shift);
- *table |= (value << shift);
+ *intedge &= ~(3 << shift);
+ *intedge |= (value << shift);
}
#endif