mirror of https://github.com/ArduPilot/ardupilot
Tracker: use AP_FWVersion singleton
This commit is contained in:
parent
485cafb343
commit
1a1ae54e07
|
@ -136,7 +136,7 @@ void Tracker::ten_hz_logging_loop()
|
||||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||||
|
|
||||||
Tracker::Tracker(void)
|
Tracker::Tracker(void)
|
||||||
: DataFlash(fwver.fw_string, g.log_bitmask)
|
: DataFlash(g.log_bitmask)
|
||||||
{
|
{
|
||||||
memset(¤t_loc, 0, sizeof(current_loc));
|
memset(¤t_loc, 0, sizeof(current_loc));
|
||||||
memset(&vehicle, 0, sizeof(vehicle));
|
memset(&vehicle, 0, sizeof(vehicle));
|
||||||
|
|
|
@ -665,11 +665,6 @@ bool GCS_MAVLINK_Tracker::set_mode(uint8_t mode)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AP_FWVersion &GCS_MAVLINK_Tracker::get_fwver() const
|
|
||||||
{
|
|
||||||
return tracker.fwver;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dummy methods to avoid having to link against AP_Camera */
|
/* dummy methods to avoid having to link against AP_Camera */
|
||||||
void AP_Camera::control_msg(mavlink_message_t const*) {}
|
void AP_Camera::control_msg(mavlink_message_t const*) {}
|
||||||
void AP_Camera::configure(float, float, float, float, float, float, float) {}
|
void AP_Camera::configure(float, float, float, float, float, float, float) {}
|
||||||
|
|
|
@ -18,7 +18,6 @@ protected:
|
||||||
AP_Mission *get_mission() override { return nullptr; };
|
AP_Mission *get_mission() override { return nullptr; };
|
||||||
AP_Rally *get_rally() const override { return nullptr; };
|
AP_Rally *get_rally() const override { return nullptr; };
|
||||||
AP_Camera *get_camera() 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;
|
uint8_t sysid_my_gcs() const override;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ void Tracker::init_tracker()
|
||||||
serial_manager.init_console();
|
serial_manager.init_console();
|
||||||
|
|
||||||
hal.console->printf("\n\nInit %s\n\nFree RAM: %u\n",
|
hal.console->printf("\n\nInit %s\n\nFree RAM: %u\n",
|
||||||
fwver.fw_string,
|
AP::fwversion().fw_string,
|
||||||
(unsigned)hal.util->available_memory());
|
(unsigned)hal.util->available_memory());
|
||||||
|
|
||||||
// Check the EEPROM format version before loading any parameters from EEPROM
|
// Check the EEPROM format version before loading any parameters from EEPROM
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <AP_Common/AP_FWVersion.h>
|
#include <AP_Common/AP_FWVersion.h>
|
||||||
|
|
||||||
const AP_FWVersion Tracker::fwver{
|
const AP_FWVersion AP_FWVersion::fwver{
|
||||||
.major = FW_MAJOR,
|
.major = FW_MAJOR,
|
||||||
.minor = FW_MINOR,
|
.minor = FW_MINOR,
|
||||||
.patch = FW_PATCH,
|
.patch = FW_PATCH,
|
||||||
|
@ -32,9 +32,16 @@ const AP_FWVersion Tracker::fwver{
|
||||||
.fw_hash_str = GIT_VERSION,
|
.fw_hash_str = GIT_VERSION,
|
||||||
#endif
|
#endif
|
||||||
#ifdef PX4_GIT_VERSION
|
#ifdef PX4_GIT_VERSION
|
||||||
|
.middleware_name = "PX4",
|
||||||
.middleware_hash_str = PX4_GIT_VERSION,
|
.middleware_hash_str = PX4_GIT_VERSION,
|
||||||
#endif
|
#endif
|
||||||
#ifdef NUTTX_GIT_VERSION
|
#ifdef NUTTX_GIT_VERSION
|
||||||
|
.os_name = "NuttX",
|
||||||
.os_hash_str = NUTTX_GIT_VERSION,
|
.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
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue