aboutsummaryrefslogtreecommitdiff
path: root/include/libopenstm32/tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libopenstm32/tools.h')
-rw-r--r--include/libopenstm32/tools.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/libopenstm32/tools.h b/include/libopenstm32/tools.h
index 2a7a0f1..8b32413 100644
--- a/include/libopenstm32/tools.h
+++ b/include/libopenstm32/tools.h
@@ -52,10 +52,10 @@
*/
#define TOG_SET_REG_BIT_MSK(REG, MSK, BIT) \
do { \
- register u16 toggle_mask = GET_REG(REG) & MSK; \
+ register u16 toggle_mask = GET_REG(REG) & (MSK); \
register u16 bit_selector; \
for (bit_selector = 1; bit_selector; bit_selector <<= 1) { \
- if ((bit_selector & BIT) != 0) \
+ if ((bit_selector & (BIT)) != 0) \
toggle_mask ^= bit_selector; \
} \
SET_REG(REG, toggle_mask); \