Browse Source

UAVCAN servers: fixed member initialization; removed dead stuff

sbg
Pavel Kirienko 9 years ago committed by Lorenz Meier
parent
commit
24e90e3c90
  1. 18
      src/modules/uavcan/uavcan_servers.cpp
  2. 35
      src/modules/uavcan/uavcan_servers.hpp

18
src/modules/uavcan/uavcan_servers.cpp

@ -88,32 +88,14 @@ UavcanServers::UavcanServers(uavcan::INode &main_node) :
_vdriver(NumIfaces, uavcan_stm32::SystemClock::instance(), main_node.getAllocator(), VirtualIfaceBlockAllocationQuota), _vdriver(NumIfaces, uavcan_stm32::SystemClock::instance(), main_node.getAllocator(), VirtualIfaceBlockAllocationQuota),
_subnode(_vdriver, uavcan_stm32::SystemClock::instance(), main_node.getAllocator()), _subnode(_vdriver, uavcan_stm32::SystemClock::instance(), main_node.getAllocator()),
_main_node(main_node), _main_node(main_node),
_tracer(),
_storage_backend(),
_fw_version_checker(),
_server_instance(_subnode, _storage_backend, _tracer), _server_instance(_subnode, _storage_backend, _tracer),
_fileserver_backend(_subnode), _fileserver_backend(_subnode),
_node_info_retriever(_subnode), _node_info_retriever(_subnode),
_fw_upgrade_trigger(_subnode, _fw_version_checker), _fw_upgrade_trigger(_subnode, _fw_version_checker),
_fw_server(_subnode, _fileserver_backend), _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_getset_client(_subnode),
_param_opcode_client(_subnode), _param_opcode_client(_subnode),
_param_restartnode_client(_subnode), _param_restartnode_client(_subnode),
_mutex_inited(false),
_check_fw(false),
_esc_enumeration_active(false),
_esc_enumeration_index(0),
_beep_pub(_subnode), _beep_pub(_subnode),
_enumeration_indication_sub(_subnode), _enumeration_indication_sub(_subnode),
_enumeration_client(_subnode), _enumeration_client(_subnode),

35
src/modules/uavcan/uavcan_servers.hpp

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

Loading…
Cancel
Save