summaryrefslogtreecommitdiffstats
path: root/ipecamera/ipecamera.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2014-01-28 00:33:20 +0100
committerSuren A. Chilingaryan <csa@suren.me>2014-01-28 00:33:20 +0100
commit0f41a2e0c38d66dc6af89d3a59a573b9a38f7ceb (patch)
treee0eed0831157e4dacd7ef902ff16d181948f5775 /ipecamera/ipecamera.c
parent9055c2d30ef1c2f87f443d987afdb6564b43b20a (diff)
downloadpcitool-0f41a2e0c38d66dc6af89d3a59a573b9a38f7ceb.tar.gz
pcitool-0f41a2e0c38d66dc6af89d3a59a573b9a38f7ceb.tar.bz2
pcitool-0f41a2e0c38d66dc6af89d3a59a573b9a38f7ceb.tar.xz
pcitool-0f41a2e0c38d66dc6af89d3a59a573b9a38f7ceb.zip
Support new revision of UFO cameras...
Diffstat (limited to 'ipecamera/ipecamera.c')
-rw-r--r--ipecamera/ipecamera.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c
index 1b8752e..54df33f 100644
--- a/ipecamera/ipecamera.c
+++ b/ipecamera/ipecamera.c
@@ -284,11 +284,17 @@ int ipecamera_start(pcilib_context_t *vctx, pcilib_event_t event_mask, pcilib_ev
return PCILIB_ERROR_INVALID_REQUEST;
}
+
// Allow readout and clean the FRAME_REQUEST mode if set for some reason
- SET_REG(control_reg, IPECAMERA_IDLE|IPECAMERA_READOUT_FLAG);
+ GET_REG(control_reg, value);
+ SET_REG(control_reg, value|IPECAMERA_READOUT_FLAG);
usleep(IPECAMERA_SLEEP_TIME);
- CHECK_STATUS_REG();
- if (err) return err;
+ if (value&0x1000) ctx->fr_mode = 1;
+ else {
+ ctx->fr_mode = 0;
+ CHECK_STATUS_REG();
+ if (err) return err;
+ }
ctx->event_id = 0;
ctx->preproc_id = 0;