|
|
|
@ -37,6 +37,8 @@ extern const AP_HAL::HAL& hal;
@@ -37,6 +37,8 @@ extern const AP_HAL::HAL& hal;
|
|
|
|
|
// storage object
|
|
|
|
|
StorageAccess AP_Mission::_storage(StorageManager::StorageMission); |
|
|
|
|
|
|
|
|
|
HAL_Semaphore_Recursive AP_Mission::_rsem; |
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
/// public mission methods
|
|
|
|
|
///
|
|
|
|
@ -463,6 +465,8 @@ bool AP_Mission::set_current_cmd(uint16_t index)
@@ -463,6 +465,8 @@ bool AP_Mission::set_current_cmd(uint16_t index)
|
|
|
|
|
/// true is return if successful
|
|
|
|
|
bool AP_Mission::read_cmd_from_storage(uint16_t index, Mission_Command& cmd) const |
|
|
|
|
{ |
|
|
|
|
WITH_SEMAPHORE(_rsem); |
|
|
|
|
|
|
|
|
|
// exit immediately if index is beyond last command but we always let cmd #0 (i.e. home) be read
|
|
|
|
|
if (index >= (unsigned)_cmd_total && index != 0) { |
|
|
|
|
return false; |
|
|
|
@ -504,6 +508,8 @@ bool AP_Mission::read_cmd_from_storage(uint16_t index, Mission_Command& cmd) con
@@ -504,6 +508,8 @@ bool AP_Mission::read_cmd_from_storage(uint16_t index, Mission_Command& cmd) con
|
|
|
|
|
/// true is returned if successful
|
|
|
|
|
bool AP_Mission::write_cmd_to_storage(uint16_t index, Mission_Command& cmd) |
|
|
|
|
{ |
|
|
|
|
WITH_SEMAPHORE(_rsem); |
|
|
|
|
|
|
|
|
|
// range check cmd's index
|
|
|
|
|
if (index >= num_commands_max()) { |
|
|
|
|
return false; |
|
|
|
|