diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-23 18:55:36 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-04-23 18:55:36 +0000 |
commit | 86153d2f0a10355bc03c69b083fa3045c45a3da0 (patch) | |
tree | b8d7b82112c6310e104772b1a814ebc98ca38a1f /os | |
parent | 226d140bb9a39f17f4f5da6217b4d43017095682 (diff) | |
download | ChibiOS-86153d2f0a10355bc03c69b083fa3045c45a3da0.tar.gz ChibiOS-86153d2f0a10355bc03c69b083fa3045c45a3da0.tar.bz2 ChibiOS-86153d2f0a10355bc03c69b083fa3045c45a3da0.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4131 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32/ext_lld.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/ext_lld.c b/os/hal/platforms/STM32/ext_lld.c index 4a3cd3c2e..ed80f524c 100644 --- a/os/hal/platforms/STM32/ext_lld.c +++ b/os/hal/platforms/STM32/ext_lld.c @@ -577,11 +577,11 @@ void ext_lld_channel_enable(EXTDriver *extp, expchannel_t channel) { /* Setting the associated GPIO for external channels.*/
if (channel < 16) {
- uint32_t n = channel & 3;
- uint32_t mask = 0xF << (channel >> 2);
+ uint32_t n = channel >> 2;
+ uint32_t mask = ~(0xF << (channel & 3));
uint32_t port = ((extp->config->channels[channel].mode &
EXT_MODE_GPIO_MASK) >>
- EXT_MODE_GPIO_OFF) << (channel >> 2);
+ EXT_MODE_GPIO_OFF) << (channel & 3);
#if defined(STM32L1XX_MD) || defined(STM32F2XX) || defined(STM32F4XX)
SYSCFG->EXTICR[n] = (SYSCFG->EXTICR[n] & mask) | port;
|