summaryrefslogtreecommitdiffstats
path: root/ipecamera
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera')
-rw-r--r--ipecamera/image.c11
-rw-r--r--ipecamera/model.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/ipecamera/image.c b/ipecamera/image.c
index 0f6afb4..0e4a849 100644
--- a/ipecamera/image.c
+++ b/ipecamera/image.c
@@ -662,17 +662,26 @@ static int ipecamera_get_image(ipecamera_t *ctx) {
if (err == PCILIB_ERROR_TIMEOUT) {
if (size > 0) err = 0;
else {
-// pcilib_error("There is no data received from IPE Camera");
+#ifdef IPECAMERA_DEBUG
pcilib_warning("There is no data received from IPE Camera for lines: %i to %i", i, i + num_lines - 1);
err = 0;
SET_REG(control_reg, IPECAMERA_IDLE);
continue;
+#else /* IPECAMERA_DEBUG */
+ pcilib_error("There is no data received from IPE Camera");
+ return err;
+#endif /* IPECAMERA_DEBUG */
}
} else pcilib_error("DMA read from IPE Camera have failed");
} else if (!size) {
+#ifdef IPECAMERA_DEBUG
pcilib_warning("There is no data received from IPE Camera for lines: %i to %i", i, i + num_lines - 1);
SET_REG(control_reg, IPECAMERA_IDLE);
continue;
+#else /* IPECAMERA_DEBUG */
+ pcilib_warning("There is no data received from IPE Camera for lines: %i to %i", i, i + num_lines - 1);
+ return err;
+#endif /* IPECAMERA_DEBUG */
}
pcilib_warning("Reading lines %i to %i: got %i bytes from DMA", i, i + num_lines - 1, size);
diff --git a/ipecamera/model.h b/ipecamera/model.h
index c102e41..2dec30a 100644
--- a/ipecamera/model.h
+++ b/ipecamera/model.h
@@ -6,7 +6,7 @@
#include "pcilib.h"
#include "image.h"
-#define IPECAMERA_DEBUG
+//#define IPECAMERA_DEBUG
#define IPECAMERA_DMA_R3
#define IPECAMERA_DMA_ADDRESS 1