summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmosis.c1
-rw-r--r--ipecamera.h8
-rw-r--r--model.c1
-rw-r--r--private.h1
-rw-r--r--reader.c9
6 files changed, 17 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 788d9f6..7e38bd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,8 @@ set(IPECAMERA_ABI_VERSION "0")
cmake_minimum_required(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+add_definitions("-fPIC --std=gnu99 -Wall -O2 -gdwarf-2 -g3 -fno-omit-frame-pointer")
+
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
pkg_check_modules(UFODECODE ufodecode>=0.3 REQUIRED)
diff --git a/cmosis.c b/cmosis.c
index b40e175..49bc1d5 100644
--- a/cmosis.c
+++ b/cmosis.c
@@ -46,7 +46,6 @@ void ipecamera_cmosis_close(pcilib_t *ctx, pcilib_register_bank_context_t *reg_b
}
pcilib_register_bank_context_t* ipecamera_cmosis_open(pcilib_t *ctx, pcilib_register_bank_t bank, const char* model, const void *args) {
- int err;
ipecamera_cmosis_context_t *bank_ctx;
bank_ctx = calloc(1, sizeof(ipecamera_cmosis_context_t));
diff --git a/ipecamera.h b/ipecamera.h
index 42994ba..d5e52d2 100644
--- a/ipecamera.h
+++ b/ipecamera.h
@@ -33,7 +33,15 @@ typedef struct {
size_t raw_size; /**< Indicates the actual size of raw data */
} ipecamera_event_info_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int ipecamera_set_buffer_size(ipecamera_t *ctx, int size);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _IPECAMERA_H */
diff --git a/model.c b/model.c
index 82cbe74..5b56522 100644
--- a/model.c
+++ b/model.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <strings.h>
#include <pcilib.h>
#include <pcilib/model.h>
diff --git a/private.h b/private.h
index 38d6dd0..2043d7a 100644
--- a/private.h
+++ b/private.h
@@ -5,6 +5,7 @@
#include <pcilib/model.h>
#include <pcilib/debug.h>
#include <pcilib/locking.h>
+#include "base.h"
#include "ipecamera.h"
#include "env.h"
diff --git a/reader.c b/reader.c
index 3e2b444..ede5b62 100644
--- a/reader.c
+++ b/reader.c
@@ -38,8 +38,10 @@
} \
}
-//#define CHECK_FRAME_MAGIC(buf) \
-// memcmp(buf, ((void*)frame_magic) + 1, sizeof(frame_magic) - 1)
+/*
+#define CHECK_FRAME_MAGIC(buf) \
+ memcmp(buf, ((void*)frame_magic) + 1, sizeof(frame_magic) - 1)
+*/
#define CHECK_FRAME_MAGIC(buf) \
memcmp(((ipecamera_payload_t*)(buf)) + 1, &frame_magic[1], sizeof(frame_magic) - sizeof(ipecamera_payload_t))
@@ -341,14 +343,13 @@ void *ipecamera_reader_thread(void *user) {
}
#ifdef IPECAMERA_BUG_STUCKED_BUSY
GET_REG(status2_reg, value);
- if (value&0x2FFFFFFF) {
+ if ((!err)&&(value&0x2FFFFFFF)) {
pcilib_warning("Camera stuck in busy, trying to recover...");
GET_REG(control_reg, saved);
SET_REG(control_reg, IPECAMERA_IDLE);
while ((value&0x2FFFFFFF)&&(ctx->run_reader)) {
usleep(IPECAMERA_NOFRAME_SLEEP);
}
- return 0;
}
#endif /* IPECAMERA_BUG_STUCKED_BUSY */
usleep(IPECAMERA_NOFRAME_SLEEP);