From: Uwe Hermann Date: Wed, 18 May 2016 22:17:16 +0000 (+0200) Subject: Add a few more code comments. X-Git-Tag: sigrok-firmware-fx2lafw-0.1.4~27 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=24373950c5858ea7761ac8aa77b51c717558316b;p=sigrok-firmware-fx2lafw.git Add a few more code comments. --- diff --git a/hantek_6022be.c b/hantek_6022be.c index 190ba89e..a62280d6 100644 --- a/hantek_6022be.c +++ b/hantek_6022be.c @@ -243,7 +243,7 @@ static BOOL set_samplerate(BYTE rate) IFCONFIG = samplerates[i].ifcfg; AUTOPTRSETUP = 7; - AUTOPTRH2 = 0xE4; + AUTOPTRH2 = 0xE4; /* 0xE400: GPIF waveform descriptor 0. */ AUTOPTRL2 = 0x00; /* @@ -260,6 +260,7 @@ static BOOL set_samplerate(BYTE rate) * jump 0, CTL2=Z, FIFO, LOOP */ + /* LENGTH / BRANCH 0-7 */ EXTAUTODAT2 = samplerates[i].wait0; EXTAUTODAT2 = samplerates[i].wait1; EXTAUTODAT2 = 1; @@ -269,24 +270,27 @@ static BOOL set_samplerate(BYTE rate) EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; + /* OPCODE 0-7 */ EXTAUTODAT2 = samplerates[i].opc0; EXTAUTODAT2 = samplerates[i].opc1; - EXTAUTODAT2 = 1; + EXTAUTODAT2 = 1; /* DATA=0 DP=1 */ EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; + /* OUTPUT 0-7 */ EXTAUTODAT2 = samplerates[i].out0; - EXTAUTODAT2 = 0x44; - EXTAUTODAT2 = 0x44; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; + EXTAUTODAT2 = 0x44; /* OE0=1, CTL0=1 */ + EXTAUTODAT2 = 0x44; /* OE0=1, CTL0=1 */ + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + /* LOGIC FUNCTION 0-7 */ EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; @@ -382,8 +386,8 @@ static void init(void) EP8CFG = 0; /* In idle mode tristate all outputs. */ - GPIFIDLECTL = 0x00; - GPIFCTLCFG = 0x80; + GPIFIDLECTL = 0x00; /* Don't enable CTL0-5 outputs. */ + GPIFCTLCFG = 0x80; /* TRICTL=1. CTL0-2: CMOS outputs, tri-statable. */ GPIFWFSELECT = 0x00; GPIFREADYSTAT = 0x00; diff --git a/sainsmart_dds120.c b/sainsmart_dds120.c index 6748d47b..a854f8d0 100644 --- a/sainsmart_dds120.c +++ b/sainsmart_dds120.c @@ -288,7 +288,7 @@ static BOOL set_samplerate(BYTE rate) IFCONFIG = samplerates[i].ifcfg; AUTOPTRSETUP = 7; - AUTOPTRH2 = 0xE4; + AUTOPTRH2 = 0xE4; /* 0xE400: GPIF waveform descriptor 0. */ AUTOPTRL2 = 0x00; /* @@ -305,6 +305,7 @@ static BOOL set_samplerate(BYTE rate) * jump 0, CTL2=Z, FIFO, LOOP */ + /* LENGTH / BRANCH 0-7 */ EXTAUTODAT2 = samplerates[i].wait0; EXTAUTODAT2 = samplerates[i].wait1; EXTAUTODAT2 = 1; @@ -314,24 +315,27 @@ static BOOL set_samplerate(BYTE rate) EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; + /* OPCODE 0-7 */ EXTAUTODAT2 = samplerates[i].opc0; EXTAUTODAT2 = samplerates[i].opc1; - EXTAUTODAT2 = 1; + EXTAUTODAT2 = 1; /* DATA=0 DP=1 */ EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; + /* OUTPUT 0-7 */ EXTAUTODAT2 = samplerates[i].out0; - EXTAUTODAT2 = 0x44; - EXTAUTODAT2 = 0x44; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; - EXTAUTODAT2 = 0x00; + EXTAUTODAT2 = 0x44; /* OE0=1, CTL0=1 */ + EXTAUTODAT2 = 0x44; /* OE0=1, CTL0=1 */ + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + EXTAUTODAT2 = 0; + /* LOGIC FUNCTION 0-7 */ EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; EXTAUTODAT2 = 0; @@ -452,8 +456,8 @@ static void init(void) EP8CFG = 0; /* In idle mode tristate all outputs. */ - GPIFIDLECTL = 0x00; - GPIFCTLCFG = 0x80; + GPIFIDLECTL = 0x00; /* Don't enable CTL0-5 outputs. */ + GPIFCTLCFG = 0x80; /* TRICTL=1. CTL0-2: CMOS outputs, tri-statable. */ GPIFWFSELECT = 0x00; GPIFREADYSTAT = 0x00;