From: Joel Holdsworth Date: Sat, 10 Mar 2012 22:45:16 +0000 (+0000) Subject: Do not read-modify-write IFCONFIG X-Git-Tag: sigrok-firmware-fx2lafw-0.1.0~51 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=809dc77960b924ec0ee1fd884f670b21039aea59;p=sigrok-firmware-fx2lafw.git Do not read-modify-write IFCONFIG --- diff --git a/gpif-acquisition.c b/gpif-acquisition.c index 65b44bf9..32fe330d 100644 --- a/gpif-acquisition.c +++ b/gpif-acquisition.c @@ -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 */