diff --git a/slsDetectorServers/gotthardDetectorServer/gitInfo.txt b/slsDetectorServers/gotthardDetectorServer/gitInfo.txt index 98b0e402f..26e8b9277 100644 --- a/slsDetectorServers/gotthardDetectorServer/gitInfo.txt +++ b/slsDetectorServers/gotthardDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorPackage/slsDetectorServers/gotthardDetectorServer URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git -Repsitory UUID: 89fa30ee4b815dd208c5e2ca0c401707eacbcef7 -Revision: 7 +Repsitory UUID: 98b5e893b180217e8ddddb95275b84d3b28a0832 +Revision: 10 Branch: refactor Last Changed Author: Dhanya_Thattil -Last Changed Rev: 4170 -Last Changed Date: 2018-11-09 11:03:24.000000002 +0100 ./RegisterDefs.h +Last Changed Rev: 4175 +Last Changed Date: 2018-12-04 13:39:41.000000002 +0100 ./.target-makefrag diff --git a/slsDetectorServers/gotthardDetectorServer/gitInfoGotthard.h b/slsDetectorServers/gotthardDetectorServer/gitInfoGotthard.h index 4a55ecee3..de9cd8e04 100644 --- a/slsDetectorServers/gotthardDetectorServer/gitInfoGotthard.h +++ b/slsDetectorServers/gotthardDetectorServer/gitInfoGotthard.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "89fa30ee4b815dd208c5e2ca0c401707eacbcef7" +#define GITREPUUID "98b5e893b180217e8ddddb95275b84d3b28a0832" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x4170 -#define GITDATE 0x20181109 +#define GITREV 0x4175 +#define GITDATE 0x20181204 #define GITBRANCH "refactor" diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index 124d2aa4d..3a8a042fd 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -1213,11 +1213,6 @@ void setDAC(enum DACINDEX ind, int val, int mV, int retval[]) { DAC_CNTRL_CLK_MSK, DAQ_CNTRL_DGTL_MSK, DAQ_CNTRL_DGTL_OFST); dacValues[ind] = val; - - /* if (ind == VREF_COMP) { // FIXME:?? - bus_w (VREF_COMP_MOD_REG, (bus_r(VREF_COMP_MOD_REG) &~ (VREF_COMP_MOD_MSK)) // reset - | ((val << VREF_COMP_MOD_OFST) & VREF_COMP_MOD_MSK)); // or it with value - }*/ #endif } diff --git a/slsDetectorServers/slsDetectorServer/blackfin.h b/slsDetectorServers/slsDetectorServer/blackfin.h index dd8c38ec7..84e7502f1 100755 --- a/slsDetectorServers/slsDetectorServer/blackfin.h +++ b/slsDetectorServers/slsDetectorServer/blackfin.h @@ -11,6 +11,7 @@ u_int64_t CSP0BASE = 0; #define CSP0 0x20200000 #define MEM_SIZE 0x100000 + /** I2C defines */ #define I2C_CLOCK_MHZ (131.25) diff --git a/slsDetectorServers/slsDetectorServer/communication_funcs.c b/slsDetectorServers/slsDetectorServer/communication_funcs.c index 620605df1..386e7a79e 100755 --- a/slsDetectorServers/slsDetectorServer/communication_funcs.c +++ b/slsDetectorServers/slsDetectorServer/communication_funcs.c @@ -10,6 +10,11 @@ #define DEFAULT_PORTNO 1952 #define DEFAULT_BACKLOG 5 +// blackfin limits +#define CPU_DRVR_SND_LMT (30000) // rough limit +#define CPU_RSND_PCKT_LOOP (10) +#define CPU_RSND_WAIT_US (1) + // Global variables from errno.h extern int errno; @@ -309,8 +314,8 @@ int sendDataOnly(int file_des, void* buf,int length) { // setting a max packet size for blackfin driver (and network driver does not do a check if packets sent) int bytesToSend = length - bytesSent; - if (bytesToSend > BLACKFIN_DRVR_SND_LMT) - bytesToSend = BLACKFIN_DRVR_SND_LMT; + if (bytesToSend > CPU_DRVR_SND_LMT) + bytesToSend = CPU_DRVR_SND_LMT; // send int rc = write(file_des, (char*)((char*)buf + bytesSent), bytesToSend); @@ -326,12 +331,12 @@ int sendDataOnly(int file_des, void* buf,int length) { (isControlServer ? "control":"stop"), retry)); ++retry; // wrote nothing for many loops - if (retry >= BLACKFIN_RSND_PCKT_LOOP) { + if (retry >= CPU_RSND_PCKT_LOOP) { FILE_LOG(logERROR, ("Could not write to %s socket. Buffer full! Too fast! No more.\n", (isControlServer ? "control":"stop"))); return bytesSent; } - usleep(BLACKFIN_RSND_WAIT_US); + usleep(CPU_RSND_WAIT_US); } // wrote something, reset retry else { diff --git a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c index 765f7e433..acbb6ba32 100755 --- a/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/slsDetectorServer_funcs.c @@ -2435,9 +2435,12 @@ int set_all_trimbits(int file_des) { int set_ctb_pattern(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); + +#ifdef CHIPTESTBOARDD int retval32 = -1; int64_t retval64 = -1; int retvals[3] = {-1, -1, -1}; +#endif int mode = -1; // mode 0: control or word @@ -2482,7 +2485,7 @@ int set_ctb_pattern(int file_des) { case 3:// wait time if (receiveData(file_des, &loopLevel, sizeof(loopLevel), INT32) < 0) return printSocketReadError(); - if (receiveData(file_des, &t, sizeof(t), INT32) < 0) + if (receiveData(file_des, &timeval, sizeof(timeval), INT64) < 0) return printSocketReadError(); case 4:// set word if (receiveData(file_des, &pattern, sizeof(pattern), INT64) < 0) @@ -2562,9 +2565,9 @@ int set_ctb_pattern(int file_des) { else if ((startAddr == -1 && stopAddr == -1 && numLoops == -1) || (Server_VerifyLock() == OK)) { setPatternLoop(loopLevel, &startAddr, &stopAddr, &numLoops); } - retval[0] = startAddr; - retval[1] = stopAddr; - retval[2] = numLoops; + retvals[0] = startAddr; + retvals[1] = stopAddr; + retvals[2] = numLoops; return Server_SendResult(file_des, INT32, UPDATE, retvals, sizeof(retvals); @@ -2659,15 +2662,17 @@ int write_adc_register(int file_des) { #else #ifndef VIRTUAL // only set - if (Server_VerifyLock() == OK) + if (Server_VerifyLock() == OK) { #ifdef JUNGFRAUD setAdc9257(addr, val); #elif GOTTHARDD - if (getBoardRevision() == 1) + if (getBoardRevision() == 1) { setAdc9252(addr, val); - else + } else { setAdc9257(addr, val); + } #endif + } #endif #endif return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);