X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hw%2Fsainsmart-dds120%2Ffw.c;h=8ddbb376f62d510142f4b1e5bd6c8f6d20dfeafc;hb=0adb2e50fd1c9d763a38dd0094f1ff80a7445771;hp=690eadf6de61aff68e236dfd94cb5390759a475f;hpb=fd70a923c92d0f33d2b7ae4bf17339e2ff28454c;p=sigrok-firmware-fx2lafw.git diff --git a/hw/sainsmart-dds120/fw.c b/hw/sainsmart-dds120/fw.c index 690eadf6..8ddbb376 100644 --- a/hw/sainsmart-dds120/fw.c +++ b/hw/sainsmart-dds120/fw.c @@ -24,21 +24,20 @@ #include #include -#define SET_ANALOG_MODE() PA7 = 1 +#define SET_ANALOG_MODE() do { PA7 = 1; } while (0) #define SET_COUPLING(x) set_coupling(x) #define SET_CALIBRATION_PULSE(x) set_calibration_pulse(x) -/* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */ /* Note: There's no PE2 as IOE is not bit-addressable (see TRM 15.2). */ -#define TOGGLE_CALIBRATION_PIN() IOE = IOE ^ 0x04 +#define TOGGLE_CALIBRATION_PIN() do { IOE = IOE ^ 0x04; } while (0) #define LED_CLEAR() NOP #define LED_GREEN() NOP #define LED_RED() NOP -#define TIMER2_VAL 1000 +#define TIMER2_VAL 500 /* CTLx pin index (IFCLK, ADC clock input). */ #define CTL_BIT 2