mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 02:20:42 +02:00
jungfrau server fix (3.1.3): delay after trigger set at testbus
This commit is contained in:
parent
144bd7124b
commit
14d227f8db
@ -75,8 +75,8 @@
|
|||||||
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
#define TIME_FROM_START_MSB_REG (0x11 << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
/* Get Delay 64 bit register */
|
/* Get Delay 64 bit register */
|
||||||
#define GET_DELAY_LSB_REG (0x12 << MEM_MAP_SHIFT)
|
#define GET_DELAY_LSB_REG (0x12 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
#define GET_DELAY_MSB_REG (0x13 << MEM_MAP_SHIFT)
|
#define GET_DELAY_MSB_REG (0x13 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
|
|
||||||
/* Get Cycles 64 bit register */
|
/* Get Cycles 64 bit register */
|
||||||
#define GET_CYCLES_LSB_REG (0x14 << MEM_MAP_SHIFT)
|
#define GET_CYCLES_LSB_REG (0x14 << MEM_MAP_SHIFT)
|
||||||
@ -349,8 +349,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Set Delay 64 bit register */
|
/* Set Delay 64 bit register */
|
||||||
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT)
|
#define SET_DELAY_LSB_REG (0x60 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
#define SET_DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT)
|
#define SET_DELAY_MSB_REG (0x61 << MEM_MAP_SHIFT) // different kind of delay
|
||||||
|
|
||||||
/* Set Cycles 64 bit register */
|
/* Set Cycles 64 bit register */
|
||||||
#define SET_CYCLES_LSB_REG (0x62 << MEM_MAP_SHIFT)
|
#define SET_CYCLES_LSB_REG (0x62 << MEM_MAP_SHIFT)
|
||||||
|
Binary file not shown.
@ -213,18 +213,21 @@ int testBus() {
|
|||||||
printf("\nTesting Bus...\n");
|
printf("\nTesting Bus...\n");
|
||||||
|
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
u_int32_t addr = SET_DELAY_LSB_REG;
|
u_int32_t addr = SET_TRIGGER_DELAY_LSB_REG;
|
||||||
int times = 1000 * 1000;
|
int times = 1000 * 1000;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < times; ++i) {
|
for (i = 0; i < times; ++i) {
|
||||||
bus_w(addr, i * 100);
|
bus_w(addr, i * 100);
|
||||||
if (i * 100 != bus_r(SET_DELAY_LSB_REG)) {
|
if (i * 100 != bus_r(addr)) {
|
||||||
cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n", i * 100, bus_r(SET_DELAY_LSB_REG));
|
cprintf(RED,"ERROR: Mismatch! Wrote 0x%x, read 0x%x\n",
|
||||||
|
i * 100, bus_r(addr));
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bus_w(addr, 0);
|
||||||
|
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
printf("Successfully tested bus %d times\n", times);
|
printf("Successfully tested bus %d times\n", times);
|
||||||
return ret;
|
return ret;
|
||||||
@ -807,12 +810,12 @@ int64_t getTimeLeft(enum timerIndex ind){
|
|||||||
retval = get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-3 * CLK_SYNC);
|
retval = get64BitReg(GET_PERIOD_LSB_REG, GET_PERIOD_MSB_REG) / (1E-3 * CLK_SYNC);
|
||||||
printf("Getting period left: %lldns\n", (long long int)retval);
|
printf("Getting period left: %lldns\n", (long long int)retval);
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case DELAY_AFTER_TRIGGER:
|
case DELAY_AFTER_TRIGGER:
|
||||||
retval = get64BitReg(GET_DELAY_LSB_REG, GET_DELAY_MSB_REG) / (1E-3 * CLK_SYNC);
|
retval = get64BitReg(xxx) / (1E-3 * CLK_SYNC);
|
||||||
printf("Getting delay left: %lldns\n", (long long int)retval);
|
printf("Getting delay left: %lldns\n", (long long int)retval);
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case CYCLES_NUMBER:
|
case CYCLES_NUMBER:
|
||||||
retval = get64BitReg(GET_CYCLES_LSB_REG, GET_CYCLES_MSB_REG);
|
retval = get64BitReg(GET_CYCLES_LSB_REG, GET_CYCLES_MSB_REG);
|
||||||
printf("Getting number of cycles left: %lld\n", (long long int)retval);
|
printf("Getting number of cycles left: %lld\n", (long long int)retval);
|
||||||
|
@ -2904,39 +2904,53 @@ int get_time_left(int file_des) {
|
|||||||
printf("getting time left on timer %d \n",ind);
|
printf("getting time left on timer %d \n",ind);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
switch(ind) {
|
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
if (ind == DELAY_AFTER_TRIGGER) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess,"Timer Left Index (%d) is not implemented for this release.\n", (int)ind);
|
||||||
|
cprintf(RED, "%s", mess);
|
||||||
|
} else {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
switch(ind) {
|
||||||
#ifdef MYTHEND
|
#ifdef MYTHEND
|
||||||
case PROBES_NUMBER:
|
case PROBES_NUMBER:
|
||||||
#elif JUNGFRAUD
|
#elif JUNGFRAUD
|
||||||
case FRAMES_FROM_START:
|
case FRAMES_FROM_START:
|
||||||
case FRAMES_FROM_START_PG:
|
case FRAMES_FROM_START_PG:
|
||||||
#elif MYTHEN3D
|
#elif MYTHEN3D
|
||||||
case GATES_NUMBER:
|
case GATES_NUMBER:
|
||||||
case PROBES_NUMBER:
|
case PROBES_NUMBER:
|
||||||
case SAMPLES_JCTB:
|
case SAMPLES_JCTB:
|
||||||
#endif
|
#endif
|
||||||
#ifndef JUNGFRAUD
|
#ifndef JUNGFRAUD
|
||||||
case GATES_NUMBER:
|
case GATES_NUMBER:
|
||||||
#endif
|
#endif
|
||||||
case FRAME_NUMBER:
|
case FRAME_NUMBER:
|
||||||
case ACQUISITION_TIME:
|
case ACQUISITION_TIME:
|
||||||
case FRAME_PERIOD:
|
case FRAME_PERIOD:
|
||||||
case DELAY_AFTER_TRIGGER:
|
case DELAY_AFTER_TRIGGER:
|
||||||
case CYCLES_NUMBER:
|
case CYCLES_NUMBER:
|
||||||
case PROGRESS:
|
case PROGRESS:
|
||||||
case ACTUAL_TIME:
|
case ACTUAL_TIME:
|
||||||
case MEASUREMENT_TIME:
|
case MEASUREMENT_TIME:
|
||||||
retval=getTimeLeft(ind);
|
retval=getTimeLeft(ind);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind);
|
sprintf(mess,"Timer Left Index (%d) is not implemented for this detector\n", (int)ind);
|
||||||
cprintf(RED, "%s", mess);
|
cprintf(RED, "%s", mess);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("Time left on timer %d is %lld\n",ind, retval);
|
printf("Time left on timer %d is %lld\n",ind, retval);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
} // end of if (ind == DELAY_AFTER_TRIGGER)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (ret==OK && differentClients)
|
if (ret==OK && differentClients)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user