MAVLink app: Make debug messages a compile time check

The debug messages are too verbose to be run in a production vehicle and inherently were something that should only be run in SITL / debug sessions on hardware. Switching the flag to the PX4_DEBUG() macro does not only make this more explicit, but also saves a lot of flash space that otherwise was consumed by the strings.
This commit is contained in:
Lorenz Meier
2018-01-13 22:02:57 -05:00
committed by Daniel Agar
parent f1a3fd09a3
commit 6227139df1
6 changed files with 64 additions and 157 deletions
+1 -9
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
* Copyright (c) 2012-2018 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -2368,9 +2368,6 @@ MavlinkReceiver::receive_thread(void *arg)
ssize_t nread = 0;
hrt_abstime last_send_update = 0;
bool verbose = _mavlink->get_verbose();
_mission_manager.set_verbose(verbose);
while (!_mavlink->_task_should_exit) {
if (poll(&fds[0], 1, timeout) > 0) {
if (_mavlink->get_protocol() == SERIAL) {
@@ -2475,11 +2472,6 @@ MavlinkReceiver::receive_thread(void *arg)
_mavlink_log_handler.send(t);
last_send_update = t;
if (verbose != _mavlink->get_verbose()) {
verbose = !verbose;
_mission_manager.set_verbose(verbose);
}
}
}