mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 16:48:01 +02:00
setmoduleid removed, moduleId changed to moduleIndex in client to minimize confusion
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -303,7 +303,7 @@ void initControlServer() {
|
||||
LOG(logINFOBLUE, ("Configuring Control server\n"));
|
||||
if (!updateFlag && initError == OK) {
|
||||
#ifndef VIRTUAL
|
||||
int detid = getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
int modid = getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
#else
|
||||
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
#endif
|
||||
@ -342,7 +342,7 @@ void initControlServer() {
|
||||
LOG(logDEBUG1, ("Control server: FEB Initialization done\n"));
|
||||
Beb_SetTopVariable(top);
|
||||
Beb_Beb();
|
||||
Beb_SetModuleId(detid);
|
||||
Beb_SetModuleId(modid);
|
||||
LOG(logDEBUG1, ("Control server: BEB Initialization done\n"));
|
||||
#endif
|
||||
// also reads config file and deactivates
|
||||
|
Binary file not shown.
@ -288,16 +288,13 @@ u_int32_t getDetectorNumber() {
|
||||
}
|
||||
|
||||
int getModuleId(int *ret, char *mess) {
|
||||
return getModuleIdInFile(ret, mess, ID_FILE);
|
||||
return ((bus_r(MOD_ID_REG) & ~MOD_ID_MSK) >> MOD_ID_OFST);
|
||||
}
|
||||
|
||||
void setModuleId(int *ret, char *mess, int arg) {
|
||||
*ret = setModuleIdInFile(mess, arg, ID_FILE);
|
||||
if (*ret == FAIL) {
|
||||
return;
|
||||
}
|
||||
void setModuleId(int modid) {
|
||||
LOG(logINFOBLUE, ("Setting module id in fpga: %d\n", modid))
|
||||
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) & ~MOD_ID_MSK);
|
||||
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) | ((arg << MOD_ID_OFST) & MOD_ID_MSK));
|
||||
bus_w(MOD_ID_REG, bus_r(MOD_ID_REG) | ((modid << MOD_ID_OFST) & MOD_ID_MSK));
|
||||
}
|
||||
|
||||
u_int64_t getDetectorMAC() {
|
||||
@ -422,10 +419,6 @@ void setupDetector() {
|
||||
sharedMemory_setStatus(IDLE);
|
||||
setupUDPCommParameters();
|
||||
#endif
|
||||
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
if (initError == FAIL) {
|
||||
return;
|
||||
}
|
||||
// pll defines
|
||||
ALTERA_PLL_C10_SetDefines(REG_OFFSET, BASE_READOUT_PLL, BASE_SYSTEM_PLL,
|
||||
PLL_RESET_REG, PLL_RESET_READOUT_MSK,
|
||||
@ -483,6 +476,14 @@ void setupDetector() {
|
||||
if (readConfigFile() == FAIL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// set module id in register
|
||||
int modid = getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
if (initError == FAIL) {
|
||||
return;
|
||||
}
|
||||
setModuleId(modid);
|
||||
|
||||
setBurstMode(DEFAULT_BURST_MODE);
|
||||
setFilterResistor(DEFAULT_FILTER_RESISTOR);
|
||||
setCDSGain(DEFAILT_CDS_GAIN);
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -444,6 +444,14 @@ void setupDetector() {
|
||||
setASICDefaults();
|
||||
setADIFDefaults();
|
||||
|
||||
// set module id in register
|
||||
getModuleIdInFile(&initError, initErrorMessage, ID_FILE);
|
||||
if (initError == FAIL) {
|
||||
return;
|
||||
}
|
||||
// until firmware is done
|
||||
// setModuleId(modid);
|
||||
|
||||
// set trigger flow for m3 (for all timing modes)
|
||||
bus_w(FLOW_TRIGGER_REG, bus_r(FLOW_TRIGGER_REG) | FLOW_TRIGGER_MSK);
|
||||
|
||||
|
@ -97,7 +97,7 @@ u_int32_t getDetectorNumber();
|
||||
int getModuleId(int *ret, char *mess);
|
||||
#endif
|
||||
#ifdef GOTTHARD2D
|
||||
void setModuleId(int *ret, char *mess, int arg);
|
||||
void setModuleId(int modid);
|
||||
#endif
|
||||
u_int64_t getDetectorMAC();
|
||||
u_int32_t getDetectorIP();
|
||||
|
@ -268,7 +268,6 @@ int get_adc_pipeline(int);
|
||||
int set_dbit_pipeline(int);
|
||||
int get_dbit_pipeline(int);
|
||||
int get_module_id(int);
|
||||
int set_module_id(int);
|
||||
int get_dest_udp_list(int);
|
||||
int set_dest_udp_list(int);
|
||||
int get_num_dest_list(int);
|
||||
|
@ -404,7 +404,6 @@ void function_table() {
|
||||
flist[F_SET_DBIT_PIPELINE] = &set_dbit_pipeline;
|
||||
flist[F_GET_DBIT_PIPELINE] = &get_dbit_pipeline;
|
||||
flist[F_GET_MODULE_ID] = &get_module_id;
|
||||
flist[F_SET_MODULE_ID] = &set_module_id;
|
||||
flist[F_GET_DEST_UDP_LIST] = &get_dest_udp_list;
|
||||
flist[F_SET_DEST_UDP_LIST] = &set_dest_udp_list;
|
||||
flist[F_GET_NUM_DEST_UDP] = &get_num_dest_list;
|
||||
@ -9029,34 +9028,6 @@ int get_module_id(int file_des) {
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int set_module_id(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int arg = -1;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||
return printSocketReadError();
|
||||
LOG(logDEBUG1, ("Setting module id to 0x%x\n", arg));
|
||||
|
||||
#ifndef GOTTHARD2D
|
||||
functionNotImplemented();
|
||||
#else
|
||||
if (arg > 0xFFFF) {
|
||||
ret = FAIL;
|
||||
sprintf(mess, "Could not set module id. Max value: 0x%x\n", 0xFFFF);
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
setModuleId(&ret, mess, arg);
|
||||
if (ret != FAIL) {
|
||||
int retval = getModuleId(&ret, mess);
|
||||
LOG(logDEBUG1, ("retval module id: %d\n", retval));
|
||||
validate(&ret, mess, arg, retval, "set module id", DEC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
||||
int get_dest_udp_list(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
|
Reference in New Issue
Block a user