/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to reader.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-21 02:20:46 UTC
  • Revision ID: csa@suren.me-20150821022046-xnfwcomw4rt4ziy1
Fix some warnings and add debugging information into the build

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        } \
39
39
    }
40
40
 
41
 
//#define CHECK_FRAME_MAGIC(buf) \
42
 
//      memcmp(buf, ((void*)frame_magic) + 1, sizeof(frame_magic) - 1)
 
41
/*
 
42
#define CHECK_FRAME_MAGIC(buf) \
 
43
        memcmp(buf, ((void*)frame_magic) + 1, sizeof(frame_magic) - 1)
 
44
*/
43
45
 
44
46
#define CHECK_FRAME_MAGIC(buf) \
45
47
        memcmp(((ipecamera_payload_t*)(buf)) + 1, &frame_magic[1], sizeof(frame_magic) - sizeof(ipecamera_payload_t))
341
343
                }
342
344
#ifdef IPECAMERA_BUG_STUCKED_BUSY
343
345
                GET_REG(status2_reg, value);
344
 
                if (value&0x2FFFFFFF) {
 
346
                if ((!err)&&(value&0x2FFFFFFF)) {
345
347
                    pcilib_warning("Camera stuck in busy, trying to recover...");
346
348
                    GET_REG(control_reg, saved);
347
349
                    SET_REG(control_reg, IPECAMERA_IDLE);
348
350
                    while ((value&0x2FFFFFFF)&&(ctx->run_reader)) {
349
351
                        usleep(IPECAMERA_NOFRAME_SLEEP);
350
352
                    }
351
 
                    return 0;
352
353
                }
353
354
#endif /* IPECAMERA_BUG_STUCKED_BUSY */
354
355
                usleep(IPECAMERA_NOFRAME_SLEEP);