gotthard udp fix

This commit is contained in:
maliakal_d 2019-08-26 11:47:28 +02:00
parent 3497175b15
commit aecf3bb7db
4 changed files with 36 additions and 3 deletions

View File

@ -8,6 +8,9 @@
/* Status register */
#define STATUS_REG (0x01 << MEM_MAP_SHIFT)
#define RUN_BUSY_OFST (0)
#define RUN_BUSY_MSK (0x00000001 << RUN_BUSY_OFST)
/* Set Cycles 64 bit register */
#define SET_CYCLES_LSB_REG (0x02 << MEM_MAP_SHIFT)
#define SET_CYCLES_MSB_REG (0x03 << MEM_MAP_SHIFT)

View File

@ -168,6 +168,12 @@ void initStopServer() {
void setupDetector() {
FILE_LOG(logINFO, ("This Server is for 1 Gotthard2 module \n"));
//Initialization of acquistion parameters
setTimer(FRAME_NUMBER, DEFAULT_NUM_FRAMES);
setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES);
setTimer(ACQUISITION_TIME, DEFAULT_EXPTIME);
setTimer(ACQUISITION_TIME, DEFAULT_PERIOD);
}
@ -324,7 +330,10 @@ void* start_timer(void* arg) {
// loop over number of frames
for(frameNr=0; frameNr!= numFrames; ++frameNr ) {
//check if virtual_stop is high, then break
//check if virtual_stop is high
if(virtual_stop == 1){
break;
}
// sleep for exposure time
struct timespec begin, end;
@ -374,12 +383,27 @@ enum runStatus getRunStatus(){
}
void readFrame(int *ret, char *mess){
// wait for status to be done
while(runBusy()){
usleep(500);
}
#ifdef VIRTUAL
FILE_LOG(logINFOGREEN, ("acquisition successfully finished\n"));
return;
#endif
}
u_int32_t runBusy() {
#ifdef VIRTUAL
return virtual_status;
#endif
u_int32_t s = (bus_r(STATUS_REG) & RUN_BUSY_MSK);
FILE_LOG(logDEBUG1, ("Status Register: %08x\n", s));
return s;
}
/* common */
int calculateDataBytes(){

View File

@ -10,3 +10,9 @@
#define NCHIP (10)
#define NDAC (16)
#define TEMP_CLK (20) /* MHz */
/** Default Parameters */
#define DEFAULT_NUM_FRAMES (1)
#define DEFAULT_NUM_CYCLES (1)
#define DEFAULT_EXPTIME (1 * 1000 * 1000) // 1 ms
#define DEFAULT_PERIOD (1 * 1000 * 1000 * 1000) // 1 s

View File

@ -386,7 +386,7 @@ int checkFifoForEndOfAcquisition();
int readFrameFromFifo();
#endif
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D)
#if defined(GOTTHARDD) || defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
u_int32_t runBusy();
#endif