AP_Mission: added truncate() function

Used when loading a mission while flying

Pair-Programmed-With: Randy Mackay <rmackay9@yahoo.com>
This commit is contained in:
Andrew Tridgell 2014-03-14 13:06:00 +11:00 committed by Randy Mackay
parent 4992e2e2cf
commit 107cc2c126
2 changed files with 12 additions and 0 deletions

View File

@ -113,6 +113,15 @@ bool AP_Mission::clear()
return true;
}
/// trucate - trunacte any mission items beyond index
void AP_Mission::truncate(uint16_t index)
{
if (_cmd_total > index) {
_cmd_total.set_and_save(index);
}
}
/// update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission
/// should be called at 10hz or higher
void AP_Mission::update()

View File

@ -130,6 +130,9 @@ public:
/// returns true if mission was running so it could not be cleared
bool clear();
/// truncate - truncate any mission items beyond given index
void truncate(uint16_t index);
/// update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission
/// should be called at 10hz or higher
void update();