Fixed harmless arithmetical overflow in the STM32_DMA_GETCHANNEL() macro.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3759 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2012-01-07 13:45:07 +00:00
parent ceabd20101
commit 75bf0b4b57
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@
* nibble
* @return Returns the channel associated to the stream.
*/
#define STM32_DMA_GETCHANNEL(id, c) ((c) >> (((id) & 7) * 4))
#define STM32_DMA_GETCHANNEL(id, c) (((c) & 15) >> (((id) & 7) * 4))
/**
* @brief Returns an unique numeric identifier for a DMA stream.

View File

@ -54,7 +54,7 @@
* nibble
* @return Returns the channel associated to the stream.
*/
#define STM32_DMA_GETCHANNEL(id, c) ((c) >> (((id) & 7) * 4))
#define STM32_DMA_GETCHANNEL(id, c) (((c) & 15) >> (((id) & 7) * 4))
/**
* @brief Returns an unique numeric identifier for a DMA stream.