aboutsummaryrefslogtreecommitdiff
path: root/include/libopenstm32/tools.h
diff options
context:
space:
mode:
authorGareth McMullin2010-11-04 16:49:03 +1300
committerGareth McMullin2010-11-04 16:49:03 +1300
commit87960830f4eb656f410ff3b220151e0b5ad9a556 (patch)
treece2ff6208c79ca40be61a27a5da0e46735ee2745 /include/libopenstm32/tools.h
parentd6eacce827a8ebffb5e82b48d4c88eb097594c1e (diff)
Fixed HALT condition handling and data toggle.
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); \