Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute_trigger forces a software trigger in all modes #195

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/dcam.camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,28 @@ enum DeviceStatusCode
aq_dcam_fire_software_trigger(struct Camera* self_)
{
struct Dcam4Camera* self = containerof(self_, struct Dcam4Camera, camera);

const HDCAM h = self->hdcam;
int trigger_source;
DCAM(prop_read(i32, h, DCAM_IDPROP_TRIGGERSOURCE, &trigger_source));

if (trigger_source != DCAMPROP_TRIGGERSOURCE__SOFTWARE) {

// Force a software trigger by temporarily disabling external
// triggering, firing a software trigger, and re-enabling the
// external trigger.

DCAM(dcamprop_setvalue(
h, DCAM_IDPROP_TRIGGERSOURCE, DCAMPROP_TRIGGERSOURCE__SOFTWARE));
}

DCAM(dcamcap_firetrigger(self->hdcam, 0));

if (trigger_source != DCAMPROP_TRIGGERSOURCE__SOFTWARE) {
// restore
DCAM(dcamprop_setvalue(h, DCAM_IDPROP_TRIGGERSOURCE, trigger_source));
}

return Device_Ok;
Error:
return Device_Err;
Expand Down
3 changes: 2 additions & 1 deletion tests/abort-finite-acquisition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ main()
};
props.video[0].camera.settings.exposure_time_us = 1e4;
props.video[0].max_frame_count = 10;
props.video[0].camera.settings.input_triggers.frame_start.line = 0;
props.video[0].camera.settings.input_triggers.frame_start.line =
0; // Ext. Trig
props.video[0].camera.settings.input_triggers.frame_start.enable = 1;

OK(acquire_configure(runtime, &props));
Expand Down
Loading