From fe55a3d3121630eda2b910bac6b051a38e3b5f60 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 23 Mar 2011 12:16:38 +0000 Subject: Fix lpc17xx GPIO interrupt handling errors git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3411 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/include/lpc17xx/irq.h | 30 +++++++++++++++--------------- nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c | 4 ++-- nuttx/arch/arm/src/lpc17xx/lpc17_gpioint.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'nuttx') diff --git a/nuttx/arch/arm/include/lpc17xx/irq.h b/nuttx/arch/arm/include/lpc17xx/irq.h index 9c09126a4..8c9777d90 100755 --- a/nuttx/arch/arm/include/lpc17xx/irq.h +++ b/nuttx/arch/arm/include/lpc17xx/irq.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/lpc17xxx/irq.h * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -223,20 +223,20 @@ # define LPC17_VALID_SHIFT2 (0) # define LPC17_VALID_FIRST2 (LPC17_VALID_FIRST0H+LPC17_VALID_NIRQS0H) -# define LPC17_IRQ_P2p0 (LPC17_IRQ_GPIOINT+0) -# define LPC17_IRQ_P2p1 (LPC17_IRQ_GPIOINT+1) -# define LPC17_IRQ_P2p2 (LPC17_IRQ_GPIOINT+2) -# define LPC17_IRQ_P2p3 (LPC17_IRQ_GPIOINT+3) -# define LPC17_IRQ_P2p4 (LPC17_IRQ_GPIOINT+4) -# define LPC17_IRQ_P2p5 (LPC17_IRQ_GPIOINT+5) -# define LPC17_IRQ_P2p6 (LPC17_IRQ_GPIOINT+6) -# define LPC17_IRQ_P2p7 (LPC17_IRQ_GPIOINT+7) -# define LPC17_IRQ_P2p8 (LPC17_IRQ_GPIOINT+8) -# define LPC17_IRQ_P2p9 (LPC17_IRQ_GPIOINT+9) -# define LPC17_IRQ_P2p10 (LPC17_IRQ_GPIOINT+10) -# define LPC17_IRQ_P2p11 (LPC17_IRQ_GPIOINT+11) -# define LPC17_IRQ_P2p12 (LPC17_IRQ_GPIOINT+12) -# define LPC17_IRQ_P2p13 (LPC17_IRQ_GPIOINT+13) +# define LPC17_IRQ_P2p0 (LPC17_VALID_FIRST2+0) +# define LPC17_IRQ_P2p1 (LPC17_VALID_FIRST2+1) +# define LPC17_IRQ_P2p2 (LPC17_VALID_FIRST2+2) +# define LPC17_IRQ_P2p3 (LPC17_VALID_FIRST2+3) +# define LPC17_IRQ_P2p4 (LPC17_VALID_FIRST2+4) +# define LPC17_IRQ_P2p5 (LPC17_VALID_FIRST2+5) +# define LPC17_IRQ_P2p6 (LPC17_VALID_FIRST2+6) +# define LPC17_IRQ_P2p7 (LPC17_VALID_FIRST2+7) +# define LPC17_IRQ_P2p8 (LPC17_VALID_FIRST2+8) +# define LPC17_IRQ_P2p9 (LPC17_VALID_FIRST2+9) +# define LPC17_IRQ_P2p10 (LPC17_VALID_FIRST2+10) +# define LPC17_IRQ_P2p11 (LPC17_VALID_FIRST2+11) +# define LPC17_IRQ_P2p12 (LPC17_VALID_FIRST2+12) +# define LPC17_IRQ_P2p13 (LPC17_VALID_FIRST2+13) # define LPC17_VALID_NIRQS2 (14) # define LPC17_NGPIOAIRQS (LPC17_VALID_NIRQS0L+LPC17_VALID_NIRQS0H+LPC17_VALID_NIRQS2) #else diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c index 0b526bd20..aa658d3e8 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_gpio.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -280,7 +280,7 @@ 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 uint64_t *intedge; + uint64_t *intedge; unsigned int shift; /* Which word to we use? */ diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_gpioint.c b/nuttx/arch/arm/src/lpc17xx/lpc17_gpioint.c index 679a44c7b..5b7672d91 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_gpioint.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_gpioint.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_gpioint.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,7 +103,7 @@ static unsigned int lpc17_getintedge(unsigned int port, unsigned int pin) /* Return the value for the PINSEL */ - return (unsigned int)((*intedge & (3 << (pin << 1))) >> shift); + return (unsigned int)(((*intedge) >> (pin << 1)) & 3); } /**************************************************************************** -- cgit v1.2.3