]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - hw/sainsmart-dds120/fw.c
Update NEWS
[sigrok-firmware-fx2lafw.git] / hw / sainsmart-dds120 / fw.c
index 690eadf6de61aff68e236dfd94cb5390759a475f..8ddbb376f62d510142f4b1e5bd6c8f6d20dfeafc 100644 (file)
 #include <delay.h>
 #include <setupdat.h>
 
-#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