mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
reset counter bit in eiger detector partially or completely
This commit is contained in:
@ -55,6 +55,8 @@ unsigned int* Feb_Control_last_downloaded_trimbits;
|
||||
int Feb_Control_module_number;
|
||||
int Feb_Control_current_index;
|
||||
|
||||
int counter_bit = 1;
|
||||
|
||||
|
||||
void Module_Module(struct Module* mod,unsigned int number, unsigned int address_top){
|
||||
unsigned int i;
|
||||
@ -1408,7 +1410,18 @@ int Feb_Control_ResetChipCompletely(){
|
||||
printf("Warning: could not ResetChipCompletely().\n");;
|
||||
return 0;
|
||||
}
|
||||
printf("Chip reset completely\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int Feb_Control_ResetChipPartially(){
|
||||
if(!Feb_Control_SetCommandRegister(DAQ_RESET_PERIPHERY & DAQ_RESET_COLUMN_SELECT) || !Feb_Control_StartDAQOnlyNWaitForFinish(5000)){
|
||||
printf("Warning: could not ResetChipPartially().\n");;
|
||||
return 0;
|
||||
}
|
||||
printf("Chip reset partially\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1524,7 +1537,12 @@ int Feb_Control_PrepareForAcquisition(){//return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!Feb_Control_ResetChipCompletely()){
|
||||
int ret=0;
|
||||
if(counter_bit)
|
||||
ret = Feb_Control_ResetChipCompletely();
|
||||
else
|
||||
ret = Feb_Control_ResetChipPartially();
|
||||
if(!ret){
|
||||
printf("Trouble resetting chips ...\n");;
|
||||
return 0;
|
||||
}
|
||||
@ -1589,3 +1607,12 @@ int Feb_Control_SaveAllTrimbitsTo(int value){
|
||||
chanregs[i] = value;
|
||||
return Feb_Control_SetTrimbits(0,chanregs);
|
||||
}
|
||||
|
||||
|
||||
void Feb_Control_Set_Counter_Bit(int value){
|
||||
counter_bit = value;
|
||||
}
|
||||
|
||||
int Feb_Control_Get_Counter_Bit(){
|
||||
return counter_bit;
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ int Feb_Control_GetModuleNumber();
|
||||
int Feb_Control_StartDAQOnlyNWaitForFinish(int sleep_time_us);
|
||||
|
||||
int Feb_Control_ResetChipCompletely();
|
||||
int Feb_Control_ResetChipPartially();
|
||||
|
||||
//struct sockaddr_in Feb_Control_serv_addr;
|
||||
/*
|
||||
@ -174,6 +175,8 @@ int Feb_Control_GetModuleNumber();
|
||||
int Feb_Control_SetTestModeVariable(int on);
|
||||
int Feb_Control_GetTestModeVariable();
|
||||
|
||||
void Feb_Control_Set_Counter_Bit(int value);
|
||||
int Feb_Control_Get_Counter_Bit();
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -441,6 +441,18 @@ int enableTenGigabitEthernet(int val){
|
||||
}
|
||||
|
||||
|
||||
int setCounterBit(int val){
|
||||
if(val!=-1){
|
||||
Feb_Control_Set_Counter_Bit(val);
|
||||
#ifdef VERBOSE
|
||||
printf("Counter Bit:%d\n",val);
|
||||
#endif
|
||||
}
|
||||
|
||||
return Feb_Control_Get_Counter_Bit();
|
||||
}
|
||||
|
||||
|
||||
int setModule(sls_detector_module myMod, int* gain, int* offset){
|
||||
int retval[2];
|
||||
int i;
|
||||
@ -582,12 +594,9 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
|
||||
|
||||
|
||||
int startReceiver(int d){
|
||||
|
||||
//reset frame number
|
||||
printf("Going to prepare for acquisition with counter_bit:%d\n",Feb_Control_Get_Counter_Bit());
|
||||
Feb_Control_PrepareForAcquisition();
|
||||
printf("Going to reset Frame Number\n");
|
||||
|
||||
//if(master)
|
||||
Feb_Control_PrepareForAcquisition();
|
||||
Beb_ResetFrameNumber();
|
||||
|
||||
return OK;
|
||||
|
Reference in New Issue
Block a user