[dc] add option to send DC commands other an extra uart link

this can be used to synchronize DC commands from the autopilot and
external processing with companion board
This commit is contained in:
Gautier Hattenberger
2018-11-30 15:15:31 +01:00
parent a1b8de2535
commit 1511d84a12
8 changed files with 36 additions and 1 deletions
@@ -41,6 +41,9 @@
void dc_send_command(uint8_t cmd)
{
atmega_i2c_cam_ctrl_send(cmd);
// call command send_command function
dc_send_command_common(cmd);
}
static struct i2c_transaction atmega_i2c_cam_ctrl_trans;
+15 -1
View File
@@ -53,6 +53,11 @@
#define DC_AUTOSHOOT_DISTANCE_INTERVAL 50
#endif
/** default distance of the first shoot: 0m (start immediately) */
#ifndef DC_AUTOSHOOT_DISTANCE_INIT
#define DC_AUTOSHOOT_DISTANCE_INIT 0
#endif
/** default distance interval for survey mode: 50m */
#ifndef DC_AUTOSHOOT_SURVEY_INTERVAL
#define DC_AUTOSHOOT_SURVEY_INTERVAL 50
@@ -181,6 +186,15 @@ uint8_t dc_info(void)
return 0;
}
void dc_send_command_common(uint8_t cmd __attribute__((unused)))
{
#if DC_SHOT_EXTRA_DL
uint8_t tab[] = { cmd };
DOWNLINK_SEND_PAYLOAD_COMMAND(extra_pprz_tp, EXTRA_DOWNLINK_DEVICE, 0, 1, tab);
#endif
}
/* shoot on distance */
uint8_t dc_distance(float interval)
{
@@ -234,7 +248,7 @@ uint8_t dc_survey(float interval, float x, float y)
dc_gps_x = x;
dc_gps_y = y;
}
dc_gps_next_dist = 0;
dc_gps_next_dist = DC_AUTOSHOOT_DISTANCE_INIT;
dc_info();
return 0;
}
+3
View File
@@ -120,6 +120,9 @@ typedef enum {
/** Send Command To Camera */
extern void dc_send_command(uint8_t cmd);
/** Command sending function */
extern void dc_send_command_common(uint8_t cmd);
/** Auotmatic Digital Camera Photo Triggering modes */
typedef enum {
DC_AUTOSHOOT_STOP = 0,
@@ -198,6 +198,9 @@ void dc_send_command(uint8_t cmd)
default:
break;
}
// call command send_command function
dc_send_command_common(cmd);
}
#endif
@@ -165,4 +165,7 @@ void dc_send_command(uint8_t cmd)
default:
break;
}
// call command send_command function
dc_send_command_common(cmd);
}
@@ -122,5 +122,8 @@ void dc_send_command(uint8_t cmd)
default:
break;
}
// call command send_command function
dc_send_command_common(cmd);
}
@@ -174,4 +174,7 @@ void dc_send_command(uint8_t cmd)
default:
break;
}
// call command send_command function
dc_send_command_common(cmd);
}
@@ -67,4 +67,7 @@ void dc_send_command(uint8_t cmd)
default:
break;
}
// call command send_command function
dc_send_command_common(cmd);
}