mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
Copter: integrate dataflash Log_Write_MavCmd
This commit is contained in:
parent
9ef920b0be
commit
2f8daf2fa9
@ -422,6 +422,14 @@ static void Log_Write_Performance()
|
|||||||
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write a mission command. Total length : 36 bytes
|
||||||
|
static void Log_Write_Cmd(const AP_Mission::Mission_Command &cmd)
|
||||||
|
{
|
||||||
|
mavlink_mission_item_t mav_cmd = {};
|
||||||
|
AP_Mission::mission_cmd_to_mavlink(cmd,mav_cmd);
|
||||||
|
DataFlash.Log_Write_MavCmd(mission.num_commands(),mav_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
struct PACKED log_Attitude {
|
struct PACKED log_Attitude {
|
||||||
LOG_PACKET_HEADER;
|
LOG_PACKET_HEADER;
|
||||||
uint32_t time_ms;
|
uint32_t time_ms;
|
||||||
@ -770,6 +778,7 @@ static void Log_Write_Optflow() {}
|
|||||||
static void Log_Write_Nav_Tuning() {}
|
static void Log_Write_Nav_Tuning() {}
|
||||||
static void Log_Write_Control_Tuning() {}
|
static void Log_Write_Control_Tuning() {}
|
||||||
static void Log_Write_Performance() {}
|
static void Log_Write_Performance() {}
|
||||||
|
static void Log_Write_Cmd(const AP_Mission::Mission_Command &cmd) {}
|
||||||
static void Log_Write_Camera() {}
|
static void Log_Write_Camera() {}
|
||||||
static void Log_Write_Error(uint8_t sub_system, uint8_t error_code) {}
|
static void Log_Write_Error(uint8_t sub_system, uint8_t error_code) {}
|
||||||
static void Log_Write_Baro(void);
|
static void Log_Write_Baro(void);
|
||||||
|
@ -24,7 +24,7 @@ static void init_home()
|
|||||||
if (g.log_bitmask & MASK_LOG_CMD) {
|
if (g.log_bitmask & MASK_LOG_CMD) {
|
||||||
AP_Mission::Mission_Command temp_cmd;
|
AP_Mission::Mission_Command temp_cmd;
|
||||||
if (mission.read_cmd_from_storage(0, temp_cmd)) {
|
if (mission.read_cmd_from_storage(0, temp_cmd)) {
|
||||||
DataFlash.Log_Write_Cmd(mission.num_commands(),temp_cmd);
|
Log_Write_Cmd(temp_cmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ static bool start_command(const AP_Mission::Mission_Command& cmd)
|
|||||||
{
|
{
|
||||||
// To-Do: logging when new commands start/end
|
// To-Do: logging when new commands start/end
|
||||||
if (g.log_bitmask & MASK_LOG_CMD) {
|
if (g.log_bitmask & MASK_LOG_CMD) {
|
||||||
DataFlash.Log_Write_Cmd(mission.num_commands(),cmd);
|
Log_Write_Cmd(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(cmd.id) {
|
switch(cmd.id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user