]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Do not read-modify-write IFCONFIG
authorJoel Holdsworth <redacted>
Sat, 10 Mar 2012 22:45:16 +0000 (22:45 +0000)
committerJoel Holdsworth <redacted>
Sat, 10 Mar 2012 22:58:18 +0000 (22:58 +0000)
gpif-acquisition.c

index 65b44bf9c72da3cb4574d4cf23f130a2ce163f7f..32fe330d980c7af11daaa40669c1b6e570c00b8d 100644 (file)
@@ -128,8 +128,21 @@ void gpif_acquisition_start(const struct cmd_start_acquisition *cmd)
 {
        xdata volatile BYTE *pSTATE;
 
-       IFCONFIG = (IFCONFIG & ~bm3048MHZ) |
-               ((cmd->flags & CMD_START_FLAGS_CLK_48MHZ) ? bm3048MHZ : 0);
+       /* Set IFCONFIG to the correct clock source */
+       if(cmd->flags & CMD_START_FLAGS_CLK_48MHZ) {
+               IFCONFIG = bmIFCLKSRC |
+                       bm3048MHZ |
+                       bmIFCLKOE |
+                       bmASYNC |
+                       bmGSTATE |
+                       bmIFGPIF;
+       } else {
+               IFCONFIG = bmIFCLKSRC |
+                       bmIFCLKOE |
+                       bmASYNC |
+                       bmGSTATE |
+                       bmIFGPIF;
+       }
 
        /* GPIF terminology: DP = decision point, NDP = non-decision-point */