From 0931efb3f0b5367dcdcab4f29f414111a75c941f Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 30 Oct 2017 19:46:12 -0400 Subject: [PATCH] vmount initialize params - fixes CID 199479 --- src/drivers/vmount/input_mavlink.cpp | 10 ++-------- src/drivers/vmount/input_mavlink.h | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/drivers/vmount/input_mavlink.cpp b/src/drivers/vmount/input_mavlink.cpp index 38c011ce8b..bc88575667 100644 --- a/src/drivers/vmount/input_mavlink.cpp +++ b/src/drivers/vmount/input_mavlink.cpp @@ -178,19 +178,13 @@ InputMavlinkCmdMount::InputMavlinkCmdMount(bool stabilize) { param_t handle = param_find("MAV_SYS_ID"); - if (handle == PARAM_INVALID) { - _mav_sys_id = 1; - - } else { + if (handle != PARAM_INVALID) { param_get(handle, &_mav_sys_id); } handle = param_find("MAV_COMP_ID"); - if (handle == PARAM_INVALID) { - _mav_comp_id = 1; - - } else { + if (handle != PARAM_INVALID) { param_get(handle, &_mav_comp_id); } } diff --git a/src/drivers/vmount/input_mavlink.h b/src/drivers/vmount/input_mavlink.h index 9479259363..424e1a60eb 100644 --- a/src/drivers/vmount/input_mavlink.h +++ b/src/drivers/vmount/input_mavlink.h @@ -98,8 +98,8 @@ private: orb_advert_t _vehicle_command_ack_pub = nullptr; bool _stabilize[3] = { false, false, false }; - int32_t _mav_sys_id; ///< our mavlink system id - int32_t _mav_comp_id; ///< our mavlink component id + int32_t _mav_sys_id{1}; ///< our mavlink system id + int32_t _mav_comp_id{1}; ///< our mavlink component id };