diff --git a/slsDetectorServers/CMakeLists.txt b/slsDetectorServers/CMakeLists.txt index 282d16920..f185b732a 100644 --- a/slsDetectorServers/CMakeLists.txt +++ b/slsDetectorServers/CMakeLists.txt @@ -23,7 +23,6 @@ add_subdirectory(ctbDetectorServer) add_subdirectory(eigerDetectorServer) add_subdirectory(gotthardDetectorServer) add_subdirectory(jungfrauDetectorServer) -#add_subdirectory(moenchDetectorServer) add_subdirectory(mythen3DetectorServer) add_subdirectory(gotthard2DetectorServer) add_subdirectory(moenchDetectorServer) diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 617c60cb4..fe6591d6f 100755 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -5,13 +5,11 @@ #include "communication_funcs_UDP.h" #include "UDPPacketHeaderGenerator.h" #include "common.h" -#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h #include "AD7689.h" // slow adcs #include "LTC2620.h" // dacs #include "MAX1932.h" // hv #include "INA226.h" // i2c #include "ALTERA_PLL.h" // pll -#include "blackfin.h" #include #include // usleep diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index d8041b3e2..d116e17c3 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2,7 +2,6 @@ #include "RegisterDefs.h" #include "versionAPI.h" #include "clogger.h" -#include "nios.h" #include "DAC6571.h" #include "LTC2620_Driver.h" #include "common.h" diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index f911da7bc..ceea144f7 100755 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -3,10 +3,8 @@ #include "clogger.h" #include "RegisterDefs.h" -#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h #include "AD9252.h" // old board compatibility #include "LTC2620.h" // dacs -#include "blackfin.h" #include "string.h" #include // usleep diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 13ed5edad..01f71a590 100755 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -2,11 +2,9 @@ #include "versionAPI.h" #include "clogger.h" -#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h #include "LTC2620.h" // dacs #include "MAX1932.h" // hv #include "ALTERA_PLL.h" // pll -#include "blackfin.h" #include "common.h" #ifdef VIRTUAL #include "communication_funcs_UDP.h" diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index 293a7c53f..979292fae 100755 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -4,12 +4,9 @@ #include "communication_funcs_UDP.h" #include "UDPPacketHeaderGenerator.h" -#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h #include "LTC2620.h" // dacs #include "MAX1932.h" // hv #include "ALTERA_PLL.h" // pll -#include "blackfin.h" -#include "readDefaultPattern.h" #include "common.h" #include diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index 1f45dc6e3..38cf3f717 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -1,7 +1,6 @@ #include "slsDetectorFunctionList.h" #include "versionAPI.h" #include "clogger.h" -#include "nios.h" #include "DAC6571.h" #include "LTC2620_Driver.h" #include "common.h" diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 4747a4c2e..6403881a0 100755 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -3,14 +3,26 @@ #ifdef GOTTHARDD #include "clogger.h" // runState(enum TLogLevel) #endif -#ifndef VIRTUAL +#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) +#include "AD9257.h" // commonServerFunctions.h, blackfin.h, ansi.h +#endif +#ifdef MOENCHD +#include "readDefaultPattern.h" +#endif + #if defined(MYTHEN3D) || defined(GOTTHARD2D) #include "programFpgaNios.h" #elif defined(CHIPTESTBOARDD) || defined(JUNGFRAUD) || defined(MOENCHD) #include "programFpgaBlackfin.h" #endif + +#if defined(MYTHEN3D) || defined(GOTTHARD2D) +#include "nios.h" +#elif defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) +#include "blackfin.h" #endif + #include #include // FILE #include @@ -107,9 +119,6 @@ int readRegister(uint32_t offset, uint32_t* retval); #elif GOTTHARDD uint32_t writeRegister16And32(uint32_t offset, uint32_t data); //FIXME its not there in ctb or moench? uint32_t readRegister16And32(uint32_t offset); -#else -extern u_int32_t writeRegister(u_int32_t offset, u_int32_t data); // blackfin.h or nios.h -extern u_int32_t readRegister(u_int32_t offset); // blackfin.h or nios.h #endif @@ -271,16 +280,6 @@ int setThresholdEnergy(int ev); #endif // parameters - dac, adc, hv -#ifdef GOTTHARDD -extern void AD9252_Set(int addr, int val); // AD9252.h (old board) -#endif -#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) -extern void AD9257_Set(int addr, int val); // AD9257.h -#endif -#if defined(CHIPTESTBOARDD) || defined(MOENCHD) -extern int AD9257_GetVrefVoltage(int mV); // AD9257.h -extern int AD9257_SetVrefVoltage(int val, int mV); // AD9257.h -#endif #ifdef GOTTHARD2D int setOnChipDAC(enum ONCHIP_DACINDEX ind, int chipIndex, int val); @@ -382,10 +381,6 @@ int getFrequency(enum CLKINDEX ind); void configureSyncFrequency(enum CLKINDEX ind); void setPipeline(enum CLKINDEX ind, int val); int getPipeline(enum CLKINDEX ind); -extern void eraseFlash(); // programFpgaBlackfin.h -extern int startWritingFPGAprogram(FILE** filefp); // programFpgaBlackfin.h -extern void stopWritingFPGAprogram(FILE* filefp); // programFpgaBlackfin.h -extern int writeFPGAProgram(char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaBlackfin.h // patterns uint64_t writePatternIOControl(uint64_t word); uint64_t writePatternClkControl(uint64_t word); @@ -403,9 +398,6 @@ uint64_t getPatternMask(); void setPatternBitMask(uint64_t mask); uint64_t getPatternBitMask(); #endif -#ifdef MOENCHD -extern int loadDefaultPattern(char* fname); // readDefaultPattern.h -#endif // jungfrau specific - powerchip, autocompdisable, clockdiv, asictimer, clock, pll, flashing firmware #ifdef JUNGFRAUD @@ -422,10 +414,6 @@ int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval); int setThresholdTemperature(int val); int setTemperatureControl(int val); int setTemperatureEvent(int val); -extern void eraseFlash(); // programFpgaBlackfin.h -extern int startWritingFPGAprogram(FILE** filefp); // programFpgaBlackfin.h -extern void stopWritingFPGAprogram(FILE* filefp); // programFpgaBlackfin.h -extern int writeFPGAProgram(char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaBlackfin.h void alignDeserializer(); // eiger specific - iodelay, pulse, rate, temp, activate, delay nw parameter @@ -504,18 +492,6 @@ void setTimingSource(enum timingSourceType value); enum timingSourceType getTimingSource(); #endif - -#if defined(MYTHEN3D) || defined(GOTTHARD2D) -extern void NotifyServerStartSuccess(); -extern void CreateNotificationForCriticalTasks(); -extern void rebootControllerAndFPGA(); // programFpgaNios.h -extern int findFlash(char* mess); // programFpgaNios.h -extern void eraseFlash(); // programFpgaNios.h -extern int eraseAndWriteToFlash(char* mess, char* fpgasrc, uint64_t fsize); // programFpgaNios.h -extern int writeFPGAProgram(char* mess, char* fpgasrc, uint64_t fsize, FILE* filefp); // programFpgaNios.h -#endif - - #if defined(JUNGFRAUD) || defined(EIGERD) int getTenGigaFlowControl(); int setTenGigaFlowControl(int value); diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h index edd5b1046..12c97c534 100755 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorServer_funcs.h @@ -20,7 +20,7 @@ void validate64(int64_t arg, int64_t retval, char* modename, enum numberMode num int executeCommand(char* command, char* result, enum TLogLevel level); int M_nofunc(int); #if defined(MYTHEN3D) || defined(GOTTHARD2D) -extern void rebootControllerAndFPGA(); +void rebootNiosControllerAndFPGA(); #endif // functions called by client diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c index 31ff1382c..a837b8511 100755 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer.c @@ -152,7 +152,7 @@ int main(int argc, char *argv[]){ FILE_LOG(logINFORED,("Rebooting!\n")); fflush(stdout); #if defined(MYTHEN3D) || defined(GOTTHARD2D) - rebootControllerAndFPGA(); + rebootNiosControllerAndFPGA(); #else system("reboot"); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index ab24df89a..0c312eb69 100755 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -611,6 +611,11 @@ int M_nofunc(int file_des) { return Server_SendResult(file_des, OTHER, NO_UPDATE, NULL, 0); } +#if defined(MYTHEN3D) || defined(GOTTHARD2D) +void rebootNiosControllerAndFPGA() { + rebootControllerAndFPGA(); +} +#endif int exec_command(int file_des) { ret = OK;