Tracker: use AP_FWVersion singleton

This commit is contained in:
Peter Barker 2018-06-13 21:31:50 +10:00 committed by Francisco Ferreira
parent 485cafb343
commit 1a1ae54e07
5 changed files with 10 additions and 9 deletions

View File

@ -136,7 +136,7 @@ void Tracker::ten_hz_logging_loop()
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
Tracker::Tracker(void)
: DataFlash(fwver.fw_string, g.log_bitmask)
: DataFlash(g.log_bitmask)
{
memset(&current_loc, 0, sizeof(current_loc));
memset(&vehicle, 0, sizeof(vehicle));

View File

@ -665,11 +665,6 @@ bool GCS_MAVLINK_Tracker::set_mode(uint8_t mode)
return false;
}
const AP_FWVersion &GCS_MAVLINK_Tracker::get_fwver() const
{
return tracker.fwver;
}
/* dummy methods to avoid having to link against AP_Camera */
void AP_Camera::control_msg(mavlink_message_t const*) {}
void AP_Camera::configure(float, float, float, float, float, float, float) {}

View File

@ -18,7 +18,6 @@ protected:
AP_Mission *get_mission() override { return nullptr; };
AP_Rally *get_rally() const override { return nullptr; };
AP_Camera *get_camera() const override { return nullptr; };
const AP_FWVersion &get_fwver() const override;
uint8_t sysid_my_gcs() const override;

View File

@ -14,7 +14,7 @@ void Tracker::init_tracker()
serial_manager.init_console();
hal.console->printf("\n\nInit %s\n\nFree RAM: %u\n",
fwver.fw_string,
AP::fwversion().fw_string,
(unsigned)hal.util->available_memory());
// Check the EEPROM format version before loading any parameters from EEPROM

View File

@ -20,7 +20,7 @@
#include <AP_Common/AP_FWVersion.h>
const AP_FWVersion Tracker::fwver{
const AP_FWVersion AP_FWVersion::fwver{
.major = FW_MAJOR,
.minor = FW_MINOR,
.patch = FW_PATCH,
@ -32,9 +32,16 @@ const AP_FWVersion Tracker::fwver{
.fw_hash_str = GIT_VERSION,
#endif
#ifdef PX4_GIT_VERSION
.middleware_name = "PX4",
.middleware_hash_str = PX4_GIT_VERSION,
#endif
#ifdef NUTTX_GIT_VERSION
.os_name = "NuttX",
.os_hash_str = NUTTX_GIT_VERSION,
#elif defined(CHIBIOS_GIT_VERSION)
.middleware_name = nullptr,
.middleware_hash_str = nullptr,
.os_name = "ChibiOS",
.os_hash_str = CHIBIOS_GIT_VERSION,
#endif
};