]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - sainsmart_dds120.c
scopes: Factor out TOGGLE_CALIBRATION_PIN().
[sigrok-firmware-fx2lafw.git] / sainsmart_dds120.c
index 26d099711203cfd76e348484486c1509bc710778..a45919619b4957485800d595ce990b1c58420394 100644 (file)
 
 #define SET_ANALOG_MODE() PA7 = 1
 
+/* 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
+
 /* Change to support as many interfaces as you need. */
 static BYTE altiface = 0;
 
@@ -66,8 +70,8 @@ void suspend_isr(void) __interrupt SUSPEND_ISR
 
 void timer2_isr(void) __interrupt TF2_ISR
 {
-       /* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */
-       IOE = IOE^0x04;
+       TOGGLE_CALIBRATION_PIN();
+
        TF2 = 0;
 }