X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hw%2Fhantek-6022bl%2Ffw.c;h=115990a9dc128145f3905d9110c6b13cfde650fe;hb=8da0cd02228bb6890eb5068e6507bf6ce0d2fdd2;hp=b2ac50172513622c247e325b70f5ac167465e03c;hpb=ba63ce8b9aba391c41cde4605ef9b941d4a879b3;p=sigrok-firmware-fx2lafw.git diff --git a/hw/hantek-6022bl/fw.c b/hw/hantek-6022bl/fw.c index b2ac5017..115990a9 100644 --- a/hw/hantek-6022bl/fw.c +++ b/hw/hantek-6022bl/fw.c @@ -24,17 +24,17 @@ #include #include -#define SET_ANALOG_MODE() PA7 = 1 +#define SET_ANALOG_MODE() do { PA7 = 1; } while (0) #define SET_COUPLING(x) #define SET_CALIBRATION_PULSE(x) -#define TOGGLE_CALIBRATION_PIN() PC2 = !PC2 +#define TOGGLE_CALIBRATION_PIN() do { PC2 = !PC2; } 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 @@ -100,7 +100,7 @@ static BOOL set_voltage(BYTE channel, BYTE val) return FALSE; } - bits = bits << (channel ? 1 : 4); + bits = bits << (channel ? 4 : 1); mask = (channel) ? 0x70 : 0x0e; IOA = (IOA & ~mask) | (bits & mask);