mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-15 17:21:38 +08:00
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:
committed by
Daniel Agar
parent
f1a3fd09a3
commit
6227139df1
@@ -469,17 +469,13 @@ protected:
|
||||
if (_cmd_sub->update_if_changed(&cmd)) {
|
||||
|
||||
if (!cmd.from_external) {
|
||||
if (_mavlink->verbose()) {
|
||||
PX4_INFO("sending command %d to %d/%d", cmd.command, cmd.target_system, cmd.target_component);
|
||||
}
|
||||
PX4_DEBUG("sending command %d to %d/%d", cmd.command, cmd.target_system, cmd.target_component);
|
||||
|
||||
MavlinkCommandSender::instance().handle_vehicle_command(cmd, _mavlink->get_channel());
|
||||
sent = true;
|
||||
|
||||
} else {
|
||||
if (_mavlink->verbose()) {
|
||||
PX4_INFO("not forwarding command %d to %d/%d", cmd.command, cmd.target_system, cmd.target_component);
|
||||
}
|
||||
PX4_DEBUG("not forwarding command %d to %d/%d", cmd.command, cmd.target_system, cmd.target_component);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user