/alps/ipecamera

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to private.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-08-12 15:37:04 UTC
  • Revision ID: csa@suren.me-20150812153704-u8vfxrs1jz00w3zc
Handle frame headers split between 2 packets

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#define IPECAMERA_BUG_MISSING_PAYLOAD           //**< CMOSIS fails to provide a first payload for each frame, therefore the frame is 32 bit shorter */
22
22
#define IPECAMERA_BUG_MULTIFRAME_PACKETS        //**< This is by design, start of packet comes directly after the end of last one in streaming mode */
 
23
#define IPECAMERA_BUG_MULTIFRAME_HEADERS        //**< UFO Camera operates with 32-byte entities, but some times there is 16-byte padding before the data which may result in spliting the header between 2 DMA packets. We still need to define a minimal number of bytes which are always in the same DMA packet (CMOSIS_ENTITY_SIZE) */
23
24
#define IPECAMERA_BUG_REPEATING_DATA            //**< 16 bytes repeated at frame offset 4096, the problem start/stop happenning on board restart */
24
25
//#define IPECAMERA_BUG_INCOMPLETE_PACKETS      //**< Support incomplete packets, i.e. check for frame magic even if full frame size is not reached yet (slow) */
25
26
//#define IPECAMERA_ANNOUNCE_READY              //**< Announce new event only after the reconstruction is done */
46
47
#define IPECAMERA_END_OF_SEQUENCE 0x1F001001
47
48
 
48
49
 
49
 
#define CMOSIS_FRAME_HEADER_SIZE        8 * sizeof(ipecamera_payload_t)
50
 
#define CMOSIS_FRAME_TAIL_SIZE          8 * sizeof(ipecamera_payload_t)
 
50
#define CMOSIS_FRAME_HEADER_SIZE        (8 * sizeof(ipecamera_payload_t))
 
51
#define CMOSIS_FRAME_TAIL_SIZE          (8 * sizeof(ipecamera_payload_t))
 
52
#ifdef IPECAMERA_BUG_MULTIFRAME_HEADERS
 
53
# define CMOSIS_ENTITY_SIZE             (4 * sizeof(ipecamera_payload_t))               //**< This normaly should be equal to 32 bytes like header and tail, but in fact is only 16 bytes */
 
54
#else /* IPECAMERA_BUG_MULTIFRAME_HEADERS */
 
55
# define CMOSIS_ENTITY_SIZE             (8 * sizeof(ipecamera_payload_t))               //**< This normaly should be equal to 32 bytes like header and tail, but in fact is only 16 bytes */
 
56
#endif /* IPECAMERA_BUG_MULTIFRAME_HEADERS */
51
57
 
52
58
#define CMOSIS_MAX_CHANNELS 16
53
59
#define CMOSIS_PIXELS_PER_CHANNEL 128
228
234
    void *buffer;
229
235
    ipecamera_change_mask_t *cmask;
230
236
    ipecamera_frame_t *frame;
231
 
    
 
237
 
 
238
#ifdef IPECAMERA_BUG_MULTIFRAME_HEADERS
 
239
    size_t saved_header_size;                           /**< If it happened that the frame header is split between 2 DMA packets, this variable holds the size of the part containing in the first packet */
 
240
    char saved_header[CMOSIS_FRAME_HEADER_SIZE];        /**< If it happened that the frame header is split between 2 DMA packets, this variable holds the part containing in the first packet */
 
241
#endif /* IPECAMERA_BUG_MULTIFRAME_HEADERS */
232
242
 
233
243
    ipecamera_image_dimensions_t dim;
234
244