ctb 1g non blocking acquire (#555)

* allowing ctb and moench 1g to have non blocking acquisition also send data, refactoring wait for acquisition finished for all others
This commit is contained in:
Dhanya Thattil
2022-09-16 17:45:51 +02:00
committed by GitHub
parent e385618d09
commit bac32dcba9
19 changed files with 99 additions and 146 deletions

View File

@ -2712,7 +2712,7 @@ void *start_timer(void *arg) {
}
sharedMemory_setStatus(IDLE);
LOG(logINFOBLUE, ("Finished Acquiring\n"));
LOG(logINFOBLUE, ("Transmitting frames done\n"));
return NULL;
}
#endif
@ -2824,26 +2824,17 @@ enum runStatus getRunStatus() {
return s;
}
void readFrame(int *ret, char *mess) {
// wait for status to be done
void waitForAcquisitionEnd() {
while (runBusy()) {
usleep(500);
}
#ifdef VIRTUAL
LOG(logINFOGREEN, ("acquisition successfully finished\n"));
return;
#endif
*ret = (int)OK;
// frames left to give status
#ifndef VIRTUAL
int64_t retval = getNumFramesLeft() + 1;
if (retval > 0) {
LOG(logERROR, ("No data and run stopped: %lld frames left\n",
(long long int)retval));
} else {
LOG(logINFOGREEN, ("Acquisition successfully finished\n"));
LOG(logINFORED, ("%lld frames left\n", (long long int)retval));
}
#endif
LOG(logINFOGREEN, ("Blocking Acquisition done\n"));
}
u_int32_t runBusy() {