diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-01 15:57:03 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-01 15:57:03 +0000 |
commit | 57f580ed6a97361104785bc4a3fccdc4c64f7d2c (patch) | |
tree | 0921622cbfdcb5d46fb3e7fcdd6169decdf9c13b /nuttx | |
parent | 03db221a3d9a6678cd8fef66ca6a35b988503b57 (diff) | |
download | px4-nuttx-57f580ed6a97361104785bc4a3fccdc4c64f7d2c.tar.gz px4-nuttx-57f580ed6a97361104785bc4a3fccdc4c64f7d2c.tar.bz2 px4-nuttx-57f580ed6a97361104785bc4a3fccdc4c64f7d2c.zip |
Fix an integer overflow bug in LPC17xx GPIO interrupt configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4247 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 6 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c | 6 | ||||
-rwxr-xr-x | nuttx/configs/olimex-lpc1766stk/src/up_leds.c | 1 |
3 files changed, 8 insertions, 5 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 1acdfdadf..b84bc3600 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2312,13 +2312,15 @@ * configs/olimex-lpc1766stk/src/up_leds.c: Add new interfaces so that is CONFIG_ARCH_LEDS are not set, the LEDs may be controlled from application logic. - *configs/olimex-lpc1766stk/src/up_buttons.c: Add support form the buttons + * configs/olimex-lpc1766stk/src/up_buttons.c: Add support form the buttons on the Olimex LPC1766-STK board. * Makefile: Added 'apps_clean' and 'apps_distclean' target to simplify managing the state of the application directory while in the NuttX directory * Documentation/NuttXGettingStarted.html: Added a "Getting Started" Guide for NuttX. At present, this is just a stub and it refers to the NuttX top-level README.txt file which is the only, real "Getting Started" Guide - that exists for the time being. + that exists at the time being. * arch/arm/src/lpc17xx/lpc17_gpioint.c: Correct an value used as the lower end of an IRQ number range test. + * arch/arm/src/lpc17xx/lpc17_gpio.c: Fix a integer flow problem in shift. + This error would prevent pins > 15 from being used as interrupt sources. diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c index 9dd594c31..4cc73a3fc 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_gpio.c @@ -301,9 +301,9 @@ static void lpc17_setintedge(unsigned int port, unsigned int pin, /* Set the requested value in the PINSEL register */ - shift = pin << 1; - *intedge &= ~(3 << shift); - *intedge |= (value << shift); + shift = pin << 1; + *intedge &= ~((uint64_t)3 << shift); + *intedge |= ((uint64_t)value << shift); } #endif diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_leds.c b/nuttx/configs/olimex-lpc1766stk/src/up_leds.c index 088f04583..c79d4a482 100755 --- a/nuttx/configs/olimex-lpc1766stk/src/up_leds.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_leds.c @@ -109,6 +109,7 @@ static bool g_uninitialized = true; void up_ledinit(void) { /* Configure all LED GPIO lines */ + led_dumpgpio("up_ledinit() Entry)"); lpc17_configgpio(LPC1766STK_LED1); |