Skip to content

Commit

Permalink
Commander: renamed print_msg_once variable into a more self-explanato…
Browse files Browse the repository at this point in the history
…ry one.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
  • Loading branch information
cmic0 committed Mar 25, 2019
1 parent 99bd6ef commit 384cfc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/modules/commander/Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3967,9 +3967,9 @@ void Commander::data_link_check(bool &status_changed)
//if avoidance never started
if (_datalink_last_heartbeat_avoidance_system == 0
&& hrt_elapsed_time(&_datalink_last_heartbeat_avoidance_system) > _oa_boot_timeout.get() * 1_s) {
if (!_print_msg_once) {
if (!_print_avoidance_msg_once) {
mavlink_log_critical(&mavlink_log_pub, "Avoidance system not available!");
_print_msg_once = true;
_print_avoidance_msg_once = true;

}
}
Expand All @@ -3980,7 +3980,7 @@ void Commander::data_link_check(bool &status_changed)
_avoidance_system_lost = true;
mavlink_log_critical(&mavlink_log_pub, "Avoidance system lost");
status_flags.avoidance_system_valid = false;
_print_msg_once = false;
_print_avoidance_msg_once = false;
}

//if status changed
Expand Down
2 changes: 1 addition & 1 deletion src/modules/commander/Commander.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Commander : public ModuleBase<Commander>, public ModuleParams
systemlib::Hysteresis _auto_disarm_landed{false};
systemlib::Hysteresis _auto_disarm_killed{false};

bool _print_msg_once{false};
bool _print_avoidance_msg_once{false};

// Subscriptions
Subscription<estimator_status_s> _estimator_status_sub{ORB_ID(estimator_status)};
Expand Down

0 comments on commit 384cfc3

Please sign in to comment.