summaryrefslogtreecommitdiffstats
path: root/ipecamera/ipecamera.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-12 15:27:13 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-12 15:27:13 +0100
commitd2dc73cab5b1c08822ce0066251e362f01525f10 (patch)
tree7ee30f3670a1df1d2acd0b84e64e8f3fdf7b47a3 /ipecamera/ipecamera.c
parentd1a0a2e0322e6c5b05ba7817c1c0405dc20e5414 (diff)
downloadpcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.gz
pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.bz2
pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.tar.xz
pcitool-d2dc73cab5b1c08822ce0066251e362f01525f10.zip
Minor fixes and improvements
Diffstat (limited to 'ipecamera/ipecamera.c')
-rw-r--r--ipecamera/ipecamera.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ipecamera/ipecamera.c b/ipecamera/ipecamera.c
index 0819284..c170174 100644
--- a/ipecamera/ipecamera.c
+++ b/ipecamera/ipecamera.c
@@ -95,8 +95,8 @@ pcilib_context_t *ipecamera_init(pcilib_t *pcilib) {
FIND_REG(status_reg, "fpga", "status");
FIND_REG(control_reg, "fpga", "control");
- FIND_REG(start_reg, "fpga", "start_address");
- FIND_REG(end_reg, "fpga", "end_address");
+
+ FIND_REG(status3_reg, "fpga", "status3");
FIND_REG(n_lines_reg, "cmosis", "number_lines");
FIND_REG(line_reg, "cmosis", "start1");
@@ -583,15 +583,23 @@ int ipecamera_trigger(pcilib_context_t *vctx, pcilib_event_t event, size_t trigg
pcilib_error("IPECamera imaging is not initialized");
return PCILIB_ERROR_NOTINITIALIZED;
}
+
+ pcilib_sleep_until_deadline(&ctx->next_trigger);
+/*
+ do {
+ usleep(10);
+ GET_REG(status3_reg, value);
+ } while (value&0x20000000);
+*/
+
SET_REG(control_reg, IPECAMERA_FRAME_REQUEST|IPECAMERA_READOUT_FLAG);
usleep(IPECAMERA_WAIT_FRAME_RCVD_TIME);
CHECK_REG(status_reg, IPECAMERA_EXPECTED_STATUS);
SET_REG(control_reg, IPECAMERA_IDLE|IPECAMERA_READOUT_FLAG);
- // DS: Just measure when next trigger is allowed instead and wait in the beginning
- usleep(IPECAMERA_NEXT_FRAME_DELAY); // minimum delay between End Of Readout and next Frame Req
+ pcilib_calc_deadline(&ctx->next_trigger, IPECAMERA_NEXT_FRAME_DELAY);
return 0;
}