Simple mbed library with macros

Dependents:   SimpleTimer SimpleUART SimpleTimer Stoppuhr1

Revision:
15:66150de7876b
Parent:
14:23c6d41cb377
Child:
18:aa026d9f7fc0
--- a/leds.h	Sat Nov 13 23:20:15 2010 +0000
+++ b/leds.h	Sun Nov 14 22:46:26 2010 +0000
@@ -37,6 +37,7 @@
 #include "mbed_globals.h"
 
 /** Bits **/
+#define LEDS_OFF 0
 #define LED1 (1 << 18)
 #define LED2 (1 << 20)
 #define LED3 (1 << 21)
@@ -46,9 +47,9 @@
 /** Macros **/
 #define LEDS_INIT()     LPC_GPIO1->FIODIR |= LEDS_MASK;
 
-#define LEDS_SET(value) {                                    \
+#define LEDS_SET(value) do {                                 \
                             LPC_GPIO1->FIOMASK = ~LEDS_MASK; \
                             LPC_GPIO1->FIOPIN = (value);     \
-                        }
+                        } while(0)
 
 #endif
\ No newline at end of file