Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
catia.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <errno.h>
#include "serial.h"
#include "chdk_pipe.h"
#include "protocol.h"
+ Include dependency graph for catia.c:

Go to the source code of this file.

Macros

#define MAX_FILENAME   512
 
#define MAX_PROCESSING_THREADS   8
 
#define MAX_IMAGE_BUFFERS   25
 
#define IMAGE_SIZE   70
 
#define SODA   "/root/develop/allthings_obc2014/src/soda/soda"
 

Functions

static void * handle_msg_shoot (void *ptr)
 
static void send_msg_image_buffer (void)
 
static void send_msg_status (void)
 
int main (int argc, char *argv[])
 

Variables

static volatile int is_shooting
 
static volatile int image_idx
 
static volatile int image_count
 
static volatile int shooting_idx
 
static volatile int shooting_count
 
static volatile int shooting_thread_count
 
static char image_buffer [MAX_IMAGE_BUFFERS][IMAGE_SIZE]
 
static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER
 

Macro Definition Documentation

◆ IMAGE_SIZE

#define IMAGE_SIZE   70

Definition at line 13 of file catia.c.

◆ MAX_FILENAME

#define MAX_FILENAME   512

Definition at line 10 of file catia.c.

◆ MAX_IMAGE_BUFFERS

#define MAX_IMAGE_BUFFERS   25

Definition at line 12 of file catia.c.

◆ MAX_PROCESSING_THREADS

#define MAX_PROCESSING_THREADS   8

Definition at line 11 of file catia.c.

◆ SODA

#define SODA   "/root/develop/allthings_obc2014/src/soda/soda"

Definition at line 15 of file catia.c.

Function Documentation

◆ handle_msg_shoot()

static void * handle_msg_shoot ( void *  ptr)
static

Definition at line 104 of file catia.c.

References chdk_pipe_shoot(), dc_shot_union::data, is_shooting, MAX_FILENAME, mut, shooting_count, shooting_thread_count, and SODA.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

◆ send_msg_image_buffer()

static void send_msg_image_buffer ( void  )
inlinestatic

Definition at line 147 of file catia.c.

References dc_shot_union::i, image_buffer, image_count, image_idx, IMAGE_SIZE, MAX_IMAGE_BUFFERS, MORA_PAYLOAD, MORA_PAYLOAD_MSG_SIZE, MoraHeader, MoraPutUint8, and MoraTrailer.

Referenced by main().

+ Here is the caller graph for this function:

◆ send_msg_status()

static void send_msg_status ( void  )
inlinestatic

Definition at line 166 of file catia.c.

References dc_shot_union::i, MORA_STATUS, MORA_STATUS_MSG_SIZE, MoraHeader, MoraPutUint8, MoraTrailer, mut, shooting_count, and shooting_thread_count.

Referenced by main().

+ Here is the caller graph for this function:

Variable Documentation

◆ image_buffer

char image_buffer[MAX_IMAGE_BUFFERS][IMAGE_SIZE]
static

Definition at line 22 of file catia.c.

Referenced by main(), and send_msg_image_buffer().

◆ image_count

volatile int image_count
static

Definition at line 21 of file catia.c.

Referenced by main(), and send_msg_image_buffer().

◆ image_idx

volatile int image_idx
static

Definition at line 21 of file catia.c.

Referenced by main(), and send_msg_image_buffer().

◆ is_shooting

volatile int is_shooting
static

Definition at line 21 of file catia.c.

Referenced by handle_msg_shoot(), and main().

◆ mut

pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER
static

◆ shooting_count

volatile int shooting_count
static

Definition at line 21 of file catia.c.

Referenced by handle_msg_shoot(), main(), and send_msg_status().

◆ shooting_idx

volatile int shooting_idx
static

Definition at line 21 of file catia.c.

Referenced by main().

◆ shooting_thread_count

volatile int shooting_thread_count
static

Definition at line 21 of file catia.c.

Referenced by handle_msg_shoot(), main(), and send_msg_status().