Browse Source

Support new revision of UFO cameras...

Suren A. Chilingaryan 10 years ago
parent
commit
0f41a2e0c3
4 changed files with 12 additions and 5 deletions
  1. 1 1
      apps/compare_to_value.c
  2. 1 1
      apps/pio_test.c
  3. 9 3
      ipecamera/ipecamera.c
  4. 1 0
      ipecamera/private.h

+ 1 - 1
apps/compare_to_value.c

@@ -62,5 +62,5 @@ int main(int argc, char *argv[]) {
     free(buf);
     
     printf("%lu of %lu is wrong\n", count, total);
-
+    return 0;
 }

+ 1 - 1
apps/pio_test.c

@@ -16,7 +16,7 @@
 //#define REALTIME
 
 #define BAR PCILIB_BAR0
-#define BITS 16
+#define BITS 32
 #define MASK ((1ll << BITS) - 1)
 
 

+ 9 - 3
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;

+ 1 - 0
ipecamera/private.h

@@ -123,6 +123,7 @@ struct ipecamera_s {
     
     size_t max_frames;		/**< Maximal number of frames what may be buffered in camera DDR memory */
     int firmware;		/**< Firmware version */
+    int fr_mode;		/**< Fast Reject mode */
     int cmosis_outputs;		/**< Number of active cmosis outputs: 4 or 16 */
     int width, height;