]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - hw/hantek-6022be/fw.c
scopes: improve C preprocessor macro robustness
[sigrok-firmware-fx2lafw.git] / hw / hantek-6022be / fw.c
index e61a32e517e66442c5f22018c841ae46c0850fa4..ec88dacea5c672abd038faf6935f97e13e70f511 100644 (file)
 
 #define SET_CALIBRATION_PULSE(x)
 
-#define TOGGLE_CALIBRATION_PIN() PA7 = !PA7
+#define TOGGLE_CALIBRATION_PIN() do { PA7 = !PA7; } while (0)
 
-#define LED_CLEAR() PC0 = 1; PC1 = 1;
-#define LED_GREEN() PC0 = 1; PC1 = 0;
-#define LED_RED()   PC0 = 0; PC1 = 1;
+#define LED_CLEAR() do { PC0 = 1; PC1 = 1; } while (0)
+#define LED_GREEN() do { PC0 = 1; PC1 = 0; } while (0)
+#define LED_RED()   do { PC0 = 0; PC1 = 1; } while (0)
 
 #define TIMER2_VAL 500