mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
jungfrauserver adcphase fix: bug was if adcphase was same as previous value, it still shifted
This commit is contained in:
parent
dd6301d66d
commit
40210ae26f
Binary file not shown.
@ -487,9 +487,11 @@ int adcPhase(int st){ /**carlos needed clkphase 1 and 2? cehck with Aldo */
|
|||||||
printf("Setting ADC Phase to %d\n",st);
|
printf("Setting ADC Phase to %d\n",st);
|
||||||
if (st > 65535 || st < -65535)
|
if (st > 65535 || st < -65535)
|
||||||
return clkPhase[0];
|
return clkPhase[0];
|
||||||
clkPhase[1] = st - clkPhase[0];
|
|
||||||
|
|
||||||
printf(" phase %d\n", clkPhase[1] );
|
clkPhase[1] = st - clkPhase[0];
|
||||||
|
if (clkPhase[1] == 0)
|
||||||
|
return clkPhase[0];
|
||||||
|
|
||||||
configurePll();
|
configurePll();
|
||||||
clkPhase[0] = st;
|
clkPhase[0] = st;
|
||||||
return clkPhase[0];
|
return clkPhase[0];
|
||||||
@ -1249,7 +1251,7 @@ void configurePll() {
|
|||||||
u_int32_t val;
|
u_int32_t val;
|
||||||
int32_t phase=0, inv=0;
|
int32_t phase=0, inv=0;
|
||||||
|
|
||||||
printf(" phase in %d\n", clkPhase[1]);
|
printf("Configuring PLL with phase in %d\n", clkPhase[1]);
|
||||||
if (clkPhase[1]>0) {
|
if (clkPhase[1]>0) {
|
||||||
inv=0;
|
inv=0;
|
||||||
phase=clkPhase[1];
|
phase=clkPhase[1];
|
||||||
|
@ -5829,9 +5829,7 @@ string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action) {
|
|||||||
return string("cannot scan speed value ")+string(args[1]);
|
return string("cannot scan speed value ")+string(args[1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
// -1 could work
|
|
||||||
else if (cmd=="adcphase")
|
|
||||||
t = 65536;
|
|
||||||
|
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
|
|
||||||
|
@ -3167,7 +3167,7 @@ int set_speed(int file_des) {
|
|||||||
#ifdef JUNGFRAUD
|
#ifdef JUNGFRAUD
|
||||||
case ADC_PHASE:
|
case ADC_PHASE:
|
||||||
retval = adcPhase(val);
|
retval = adcPhase(val);
|
||||||
if ((val != 65536) && (retval!=val) && (val>=0)) {
|
if ((val != 100000) && (retval!=val) && (val>=0)) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"could not change set adc phase: should be %d but is %d \n", val, retval);
|
sprintf(mess,"could not change set adc phase: should be %d but is %d \n", val, retval);
|
||||||
cprintf(RED, "Warning: %s", mess);
|
cprintf(RED, "Warning: %s", mess);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user