mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-25 07:40:03 +02:00
Change SetTrimbits() and SaveAllTrimbits() to rely on top/bottom signal instead of TopAddressIsValid() for further cleanup.
This commit is contained in:
parent
a7f5300455
commit
3d00eed0f0
@ -898,7 +898,7 @@ int Feb_Control_SendDACValue(unsigned int dst_num, unsigned int ch, unsigned int
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits) {
|
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits, int top) {
|
||||||
LOG(logINFO, ("Setting Trimbits\n"));
|
LOG(logINFO, ("Setting Trimbits\n"));
|
||||||
|
|
||||||
//for (int iy=10000;iy<20020;++iy)//263681
|
//for (int iy=10000;iy<20020;++iy)//263681
|
||||||
@ -963,7 +963,7 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits) {
|
|||||||
int i;
|
int i;
|
||||||
for(i=0;i<8;i++) { // column loop i
|
for(i=0;i<8;i++) { // column loop i
|
||||||
|
|
||||||
if (Module_TopAddressIsValid(&modules[1])) {
|
if (top==1) {
|
||||||
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low
|
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low
|
||||||
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper
|
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper
|
||||||
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low
|
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low
|
||||||
@ -1572,12 +1572,12 @@ int Feb_Control_StopAcquisition() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Feb_Control_SaveAllTrimbitsTo(int value) {
|
int Feb_Control_SaveAllTrimbitsTo(int value, int top) {
|
||||||
unsigned int chanregs[Feb_Control_trimbit_size];
|
unsigned int chanregs[Feb_Control_trimbit_size];
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<Feb_Control_trimbit_size;i++)
|
for(i=0;i<Feb_Control_trimbit_size;i++)
|
||||||
chanregs[i] = value;
|
chanregs[i] = value;
|
||||||
return Feb_Control_SetTrimbits(0,chanregs);
|
return Feb_Control_SetTrimbits(0,chanregs, top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,9 +93,9 @@ int Feb_Control_SetDAC(char* s, int value, int is_a_voltage_mv);
|
|||||||
int Feb_Control_GetDAC(char* s, int* ret_value, int voltage_mv);
|
int Feb_Control_GetDAC(char* s, int* ret_value, int voltage_mv);
|
||||||
int Feb_Control_GetDACName(unsigned int dac_num,char* s);
|
int Feb_Control_GetDACName(unsigned int dac_num,char* s);
|
||||||
|
|
||||||
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int* trimbits);
|
int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int* trimbits, int top);
|
||||||
unsigned int* Feb_Control_GetTrimbits();
|
unsigned int* Feb_Control_GetTrimbits();
|
||||||
int Feb_Control_SaveAllTrimbitsTo(int value);
|
int Feb_Control_SaveAllTrimbitsTo(int value, int top);
|
||||||
int Feb_Control_Reset();
|
int Feb_Control_Reset();
|
||||||
int Feb_Control_PrepareForAcquisition();
|
int Feb_Control_PrepareForAcquisition();
|
||||||
|
|
||||||
|
Binary file not shown.
@ -890,7 +890,7 @@ int setModule(sls_detector_module myMod, char* mess) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set trimbits
|
//set trimbits
|
||||||
if (!Feb_Control_SetTrimbits(Feb_Control_GetModuleNumber(), tt)) {
|
if (!Feb_Control_SetTrimbits(Feb_Control_GetModuleNumber(), tt,top)) {
|
||||||
sprintf(mess, "Could not set module. Could not set trimbits\n");
|
sprintf(mess, "Could not set module. Could not set trimbits\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
setSettings(UNDEFINED);
|
setSettings(UNDEFINED);
|
||||||
@ -1671,7 +1671,7 @@ void setExternalGating(int enable[]) {
|
|||||||
|
|
||||||
int setAllTrimbits(int val) {
|
int setAllTrimbits(int val) {
|
||||||
#ifndef VIRTUAL
|
#ifndef VIRTUAL
|
||||||
if (!Feb_Control_SaveAllTrimbitsTo(val)) {
|
if (!Feb_Control_SaveAllTrimbitsTo(val,top)) {
|
||||||
LOG(logERROR, ("Could not set all trimbits\n"));
|
LOG(logERROR, ("Could not set all trimbits\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user