aboutsummaryrefslogtreecommitdiff
path: root/include/libopenstm32/tools.h
diff options
context:
space:
mode:
authorUwe Hermann2010-11-02 02:02:21 +0100
committerUwe Hermann2010-11-02 02:02:21 +0100
commit6e090ccee16582f0c152c95238753562732788e3 (patch)
treedc81ec432c2144af3c01803be2c953005048cd36 /include/libopenstm32/tools.h
parent1621fde1f47c5b5f86942562b955bebfb45683df (diff)
Initial USB device stack for STM32.
Patch provided by Gareth McMullin <gareth@blacksphere.co.nz>, thanks a lot!
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 54c3ce7..2a7a0f1 100644
--- a/include/libopenstm32/tools.h
+++ b/include/libopenstm32/tools.h
@@ -51,7 +51,7 @@
* TODO: We may need a faster implementation of that one?
*/
#define TOG_SET_REG_BIT_MSK(REG, MSK, BIT) \
-{ \
+do { \
register u16 toggle_mask = GET_REG(REG) & MSK; \
register u16 bit_selector; \
for (bit_selector = 1; bit_selector; bit_selector <<= 1) { \
@@ -59,6 +59,6 @@
toggle_mask ^= bit_selector; \
} \
SET_REG(REG, toggle_mask); \
-}
+} while(0)
#endif