summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2019-03-15 16:40:04 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2019-03-15 16:40:04 -0700
commit9cb761930e158a159681194734f0d1b925ec2ed6 (patch)
tree8d7abdec92b1cb7d94963a56e3ea06ee69df8c59
parent132d623a422e1b73f6e5d8911a82a75290637d10 (diff)
cancel any existing exposure/readout operation on camera connection
-rw-r--r--src/qhyccd/QHYCCDCam.rs1
-rw-r--r--src/qhyccd/mod.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/qhyccd/QHYCCDCam.rs b/src/qhyccd/QHYCCDCam.rs
index 6194835..37deef9 100644
--- a/src/qhyccd/QHYCCDCam.rs
+++ b/src/qhyccd/QHYCCDCam.rs
@@ -115,6 +115,7 @@ extern "C" {
imagew: *mut os::raw::c_int, imageh: *mut os::raw::c_int,
pixelw: *mut os::raw::c_double, pixelh: *mut os::raw::c_double,
bpp: *mut os::raw::c_int) -> os::raw::c_int;
+ pub fn CancelQHYCCDExposingAndReadout(handle: *mut os::raw::c_void) -> os::raw::c_int;
pub fn ControlQHYCCDTemp(handle: *mut os::raw::c_void, target: os::raw::c_double) -> os::raw::c_int;
pub fn SetQHYCCDDebayerOnOff(handle: *mut os::raw::c_void, onoff: os::raw::c_int) -> os::raw::c_int;
pub fn SetQHYCCDBinMode(handle: *mut os::raw::c_void, wbin: os::raw::c_int, hbin: os::raw::c_int) -> os::raw::c_int;
diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs
index 192b943..0ce31e2 100644
--- a/src/qhyccd/mod.rs
+++ b/src/qhyccd/mod.rs
@@ -64,6 +64,7 @@ pub fn acquire(camera_idx: i32) -> Result<Camera> {
}
check(QHYCCDCam::SetQHYCCDStreamMode(handle, 0))?; // 0 means single frame mode...
check(QHYCCDCam::InitQHYCCD(handle))?;
+ check(QHYCCDCam::CancelQHYCCDExposingAndReadout(handle))?;
Ok(Camera {
handle: handle
})