This commit is contained in:
2021-06-25 16:54:01 +02:00
parent bbb2473387
commit bdfd151a01

View File

@ -1045,41 +1045,39 @@ int Feb_Control_SendSoftwareTrigger() {
int Feb_Control_SoftwareTrigger(int block) { int Feb_Control_SoftwareTrigger(int block) {
if (Feb_Control_activated) { if (Feb_Control_activated) {
/* // cant read reg
// cant read reg int readyForTrigger = 0;
int readyForTrigger = 0; if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) { LOG(logERROR, ("Could not read FEB_REG_STATUS reg!\n"));
LOG(logERROR, ("Could not read FEB_REG_STATUS reg!\n")); return 0;
return 0; }
} // if not ready for trigger, throw
// if not ready for trigger, throw if (!readyForTrigger) {
if (!readyForTrigger) { LOG(logWARNING, ("Not yet ready for trigger!\n"));
LOG(logWARNING, ("Not yet ready for trigger!\n")); return 0;
return 0; }
}
*/
// send trigger to both fpgas // send trigger to both fpgas
Feb_Control_SendSoftwareTrigger(); Feb_Control_SendSoftwareTrigger();
/*
// wait for next trigger ready // wait for next trigger ready
if (block) { if (block) {
int readyForTrigger = 0; int readyForTrigger = 0;
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) { if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
LOG(logERROR, ("Could not read FEB_REG_STATUS reg after LOG(logERROR, ("Could not read FEB_REG_STATUS reg after
givign " "trigger!\n")); return 0; givign " "trigger!\n")); return 0;
} }
while (!readyForTrigger) { while (!readyForTrigger) {
LOG(logWARNING, ("Not yet ready\n")); LOG(logWARNING, ("Not yet ready\n"));
usleep(100); usleep(100);
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) { if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
LOG(logERROR, ("Could not read FEB_REG_STATUS reg LOG(logERROR, ("Could not read FEB_REG_STATUS reg
after " "givign trigger!\n")); return 0; after " "givign trigger!\n")); return 0;
}
}
LOG(logINFO, ("Ready for trigger!\n"));
} }
*/ }
LOG(logINFO, ("Ready for trigger!\n"));
}
} }
return 1; return 1;