UAVCAN servers: fixed member initialization; removed dead stuff

This commit is contained in:
Pavel Kirienko 2016-08-07 14:25:43 +03:00 committed by Lorenz Meier
parent d12be196a2
commit 24e90e3c90
2 changed files with 17 additions and 36 deletions

View File

@ -88,32 +88,14 @@ UavcanServers::UavcanServers(uavcan::INode &main_node) :
_vdriver(NumIfaces, uavcan_stm32::SystemClock::instance(), main_node.getAllocator(), VirtualIfaceBlockAllocationQuota),
_subnode(_vdriver, uavcan_stm32::SystemClock::instance(), main_node.getAllocator()),
_main_node(main_node),
_tracer(),
_storage_backend(),
_fw_version_checker(),
_server_instance(_subnode, _storage_backend, _tracer),
_fileserver_backend(_subnode),
_node_info_retriever(_subnode),
_fw_upgrade_trigger(_subnode, _fw_version_checker),
_fw_server(_subnode, _fileserver_backend),
_count_in_progress(false),
_count_index(0),
_param_in_progress(0),
_param_index(0),
_param_list_in_progress(false),
_param_list_all_nodes(false),
_param_list_node_id(1),
_param_dirty_bitmap{0, 0, 0, 0},
_param_save_opcode(0),
_cmd_in_progress(false),
_param_response_pub(nullptr),
_param_getset_client(_subnode),
_param_opcode_client(_subnode),
_param_restartnode_client(_subnode),
_mutex_inited(false),
_check_fw(false),
_esc_enumeration_active(false),
_esc_enumeration_index(0),
_beep_pub(_subnode),
_enumeration_indication_sub(_subnode),
_enumeration_client(_subnode),

View File

@ -142,23 +142,23 @@ private:
*
* The node's UAVCAN ID is used as the index into the _param_counts array.
*/
uint8_t _param_counts[128];
bool _count_in_progress;
uint8_t _count_index;
uint8_t _param_counts[128] = {};
bool _count_in_progress = false;
uint8_t _count_index = 0;
bool _param_in_progress;
uint8_t _param_index;
bool _param_list_in_progress;
bool _param_list_all_nodes;
uint8_t _param_list_node_id;
bool _param_in_progress = false;
uint8_t _param_index = 0;
bool _param_list_in_progress = false;
bool _param_list_all_nodes = false;
uint8_t _param_list_node_id = 1;
uint32_t _param_dirty_bitmap[4];
uint8_t _param_save_opcode;
uint32_t _param_dirty_bitmap[4] = {};
uint8_t _param_save_opcode = 0;
bool _cmd_in_progress;
bool _cmd_in_progress = false;
// uORB topic handle for MAVLink parameter responses
orb_advert_t _param_response_pub;
orb_advert_t _param_response_pub = nullptr;
typedef uavcan::MethodBinder<UavcanServers *,
void (UavcanServers::*)(const uavcan::ServiceCallResult<uavcan::protocol::param::GetSet> &)> GetSetCallback;
@ -185,15 +185,14 @@ private:
void beep(float frequency);
bool _mutex_inited;
volatile bool _check_fw;
bool _mutex_inited = false;
volatile bool _check_fw = false;
// ESC enumeration
bool _esc_enumeration_active;
bool _esc_enumeration_active = false;
uint8_t _esc_enumeration_ids[uavcan::equipment::esc::RawCommand::FieldTypes::cmd::MaxSize];
uint8_t _esc_enumeration_index;
uint8_t _esc_set_index;
uint8_t _esc_count;
uint8_t _esc_enumeration_index = 0;
uint8_t _esc_count = 0;
typedef uavcan::MethodBinder<UavcanServers *,
void (UavcanServers::*)(const uavcan::ServiceCallResult<uavcan::protocol::enumeration::Begin> &)> EnumerationBeginCallback;