eiger: block trigger till next wait for trigger and give error if it wasnt ready when trigger sent

This commit is contained in:
2021-06-25 16:56:48 +02:00
parent bdfd151a01
commit 1360fbac87

View File

@ -1064,16 +1064,18 @@ int Feb_Control_SoftwareTrigger(int block) {
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 giving "
givign " "trigger!\n")); return 0; "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 "
after " "givign trigger!\n")); return 0; "giving trigger!\n"));
return 0;
} }
} }
LOG(logINFO, ("Ready for trigger!\n")); LOG(logINFO, ("Ready for trigger!\n"));