]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - hantek_6022bl.c
scopes: Factor out SET_ANALOG_MODE().
[sigrok-firmware-fx2lafw.git] / hantek_6022bl.c
index 99e43c97218382f104172250f795be03ae059cd4..a380ad08dc1a34d078004f22d867a2391462c038 100644 (file)
@@ -24,6 +24,8 @@
 #include <delay.h>
 #include <setupdat.h>
 
+#define SET_ANALOG_MODE() PA7 = 1
+
 /* Change to support as many interfaces as you need. */
 static BYTE altiface = 0;
 
@@ -165,8 +167,7 @@ static void start_sampling(void)
 {
        int i;
 
-       /* Set analog mode. */
-       PA7 = 1;
+       SET_ANALOG_MODE();
 
        clear_fifo();
 
@@ -393,8 +394,7 @@ static void init(void)
        EP4CFG = 0;
        EP8CFG = 0;
 
-       /* Set analog mode. */
-       PA7 = 1;
+       SET_ANALOG_MODE();
 
        /* In idle mode tristate all outputs. */
        GPIFIDLECTL = 0x00; /* Don't enable CTL0-5 outputs. */