mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
Rover: if receiving last mission item then log new mission to dataflash
This commit is contained in:
parent
ba29967454
commit
06796cd994
@ -1068,7 +1068,9 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
||||
// XXX receive a WP from GCS and store in EEPROM
|
||||
case MAVLINK_MSG_ID_MISSION_ITEM:
|
||||
{
|
||||
handle_mission_item(msg, mission);
|
||||
if (handle_mission_item(msg, mission)) {
|
||||
Log_Write_EntireMission();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -244,9 +244,16 @@ static void Log_Write_Startup(uint8_t type)
|
||||
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
||||
|
||||
// write all commands to the dataflash as well
|
||||
Log_Write_EntireMission();
|
||||
}
|
||||
|
||||
static void Log_Write_EntireMission()
|
||||
{
|
||||
gcs_send_text_P(SEVERITY_LOW, PSTR("New mission"));
|
||||
|
||||
AP_Mission::Mission_Command cmd;
|
||||
for (uint16_t i = 0; i < mission.num_commands(); i++) {
|
||||
if(mission.read_cmd_from_storage(i,cmd)) {
|
||||
if (mission.read_cmd_from_storage(i,cmd)) {
|
||||
Log_Write_Cmd(cmd);
|
||||
}
|
||||
}
|
||||
@ -430,6 +437,7 @@ static void start_logging()
|
||||
|
||||
// dummy functions
|
||||
static void Log_Write_Startup(uint8_t type) {}
|
||||
static void Log_Write_EntireMission() {}
|
||||
static void Log_Write_Current() {}
|
||||
static void Log_Write_Nav_Tuning() {}
|
||||
static void Log_Write_Performance() {}
|
||||
|
Loading…
Reference in New Issue
Block a user