mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
wip
This commit is contained in:
@ -1046,41 +1046,42 @@ int Feb_Control_SendSoftwareTrigger() {
|
|||||||
int Feb_Control_SoftwareTrigger(int block) {
|
int Feb_Control_SoftwareTrigger(int block) {
|
||||||
if (Feb_Control_activated) {
|
if (Feb_Control_activated) {
|
||||||
/*
|
/*
|
||||||
// if not ready for trigger, throw
|
// 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"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// if not ready for trigger, throw
|
||||||
|
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();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// will need to wait if delay after trigger introduced
|
// wait for next trigger ready
|
||||||
// usleep(0);
|
|
||||||
// wait for exposure to be done
|
|
||||||
if (block) {
|
if (block) {
|
||||||
for (int i = 0; i < 1; ++i) {
|
int readyForTrigger = 0;
|
||||||
prev_toggle[i] = falling[i];
|
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
|
||||||
while (prev_toggle[i] == falling[i]) {
|
LOG(logERROR, ("Could not read FEB_REG_STATUS reg after
|
||||||
usleep(5000);
|
givign " "trigger!\n")); return 0;
|
||||||
if (!Feb_Control_GetExposureStatus(
|
}
|
||||||
i, &rising[i], &falling[i], &exposure[i])) {
|
|
||||||
return 0;
|
while (!readyForTrigger) {
|
||||||
}
|
LOG(logWARNING, ("Not yet ready\n"));
|
||||||
}
|
usleep(100);
|
||||||
// exposure low
|
if (!Feb_Control_IsReadyForTrigger(&readyForTrigger)) {
|
||||||
if (exposure[i]) {
|
LOG(logERROR, ("Could not read FEB_REG_STATUS reg
|
||||||
LOG(logERROR,
|
after " "givign trigger!\n")); return 0;
|
||||||
("Software trigger failed. Still exposing after
|
|
||||||
" "exposure finished toggled in %s fpga.\n", i == 1 ? "left" :
|
|
||||||
"right")); return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LOG(logINFO, ("Ready for trigger!\n"));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user