From 81d60af4a8a6a1511360cf63e16298dee2fe8b26 Mon Sep 17 00:00:00 2001 From: Matthias Badaire Date: Fri, 16 Jan 2015 23:12:24 +0100 Subject: [PATCH] AP_Mount_Alexmos : cleanup initialization of class fields --- libraries/AP_Mount/AP_Mount_Alexmos.cpp | 5 ----- libraries/AP_Mount/AP_Mount_Alexmos.h | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.cpp b/libraries/AP_Mount/AP_Mount_Alexmos.cpp index 925c20543b..2bacfaf021 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.cpp +++ b/libraries/AP_Mount/AP_Mount_Alexmos.cpp @@ -5,14 +5,9 @@ extern const AP_HAL::HAL& hal; void AP_Mount_Alexmos::init () { - _board_version = 0; - _current_firmware_version = 0.0f; - _firmware_beta_version = 0; _port = hal.uartE; _port->begin(115200); _initialised = true; - _step = 0; - _param_read_once=false; get_boardinfo(); read_params(0); //we request parameters for profile 0 and therfore get global and profile parameters } diff --git a/libraries/AP_Mount/AP_Mount_Alexmos.h b/libraries/AP_Mount/AP_Mount_Alexmos.h index c1293bd1e5..2979a92b0e 100644 --- a/libraries/AP_Mount/AP_Mount_Alexmos.h +++ b/libraries/AP_Mount/AP_Mount_Alexmos.h @@ -72,7 +72,19 @@ public: //constructor AP_Mount_Alexmos(AP_Mount &frontend, uint8_t instance): AP_Mount_Backend(frontend, instance), - _initialised(false) + _initialised(false), + _board_version(0), + _current_firmware_version(0.0f), + _firmware_beta_version(0), + _gimbal_3axis(false), + _gimbal_bat_monitoring(false), + _current_angle(0,0,0), + _param_read_once(false), + _checksum(0), + _step(0), + _command_id(0), + _payload_length(0), + _payload_counter(0) {} // init - performs any required initialisation for this instance @@ -287,8 +299,8 @@ private: uint8_t _checksum ; uint8_t _step ; uint8_t _command_id; - uint8_t _payload_length ; - uint8_t _payload_counter ; + uint8_t _payload_length; + uint8_t _payload_counter; // confirmed that last command was ok bool _last_command_confirmed;