mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 04:46:51 +08:00
[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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user