diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-08-21 04:20:46 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-08-21 04:20:46 +0200 |
commit | c392c9920f9baadc9267e726b46b9c64c82915c7 (patch) | |
tree | 91f3749ef5e3c3b2654348d2a9f3788452fde989 | |
parent | fe3f8e3e172818741f32f5ea0bba27f77ca56a1a (diff) | |
download | ipecamera-c392c9920f9baadc9267e726b46b9c64c82915c7.tar.gz ipecamera-c392c9920f9baadc9267e726b46b9c64c82915c7.tar.bz2 ipecamera-c392c9920f9baadc9267e726b46b9c64c82915c7.tar.xz ipecamera-c392c9920f9baadc9267e726b46b9c64c82915c7.zip |
Fix some warnings and add debugging information into the build
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | cmosis.c | 1 | ||||
-rw-r--r-- | ipecamera.h | 8 | ||||
-rw-r--r-- | model.c | 1 | ||||
-rw-r--r-- | private.h | 1 | ||||
-rw-r--r-- | reader.c | 9 |
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) @@ -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 */ @@ -1,4 +1,5 @@ #include <stdio.h> +#include <strings.h> #include <pcilib.h> #include <pcilib/model.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" @@ -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); |