Browse Source

AntennaTracker: use separate header for version macro

Having the version macro in the config.h and consequently in the main
vehicle header means that whenever the version changes we need to
compiler the whole vehicle again. This would not be so bad if we weren't
also appending the git hash in the version. In this case, whenever we
commit to the repository we would need to recompile everything.

Move to a separate header that is include only by its users. Then
instead of compiling everything we will compile just a few files.
master
Lucas De Marchi 9 years ago
parent
commit
49a46e463f
  1. 2
      AntennaTracker/AntennaTracker.cpp
  2. 1
      AntennaTracker/GCS_Mavlink.cpp
  3. 8
      AntennaTracker/Tracker.h
  4. 10
      AntennaTracker/config.h
  5. 1
      AntennaTracker/system.cpp
  6. 10
      AntennaTracker/version.h

2
AntennaTracker/AntennaTracker.cpp

@ -20,6 +20,7 @@
*/ */
#include "Tracker.h" #include "Tracker.h"
#include "version.h"
#define SCHED_TASK(func, _interval_ticks, _max_time_micros) SCHED_TASK_CLASS(Tracker, &tracker, func, _interval_ticks, _max_time_micros) #define SCHED_TASK(func, _interval_ticks, _max_time_micros) SCHED_TASK_CLASS(Tracker, &tracker, func, _interval_ticks, _max_time_micros)
@ -135,6 +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{FIRMWARE_STRING}
{ {
memset(&current_loc, 0, sizeof(current_loc)); memset(&current_loc, 0, sizeof(current_loc));
memset(&vehicle, 0, sizeof(vehicle)); memset(&vehicle, 0, sizeof(vehicle));

1
AntennaTracker/GCS_Mavlink.cpp

@ -1,6 +1,7 @@
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "Tracker.h" #include "Tracker.h"
#include "version.h"
// default sensors are present and healthy: gyro, accelerometer, barometer, rate_control, attitude_stabilization, yaw_position, altitude control, x/y position control, motor_control // default sensors are present and healthy: gyro, accelerometer, barometer, rate_control, attitude_stabilization, yaw_position, altitude control, x/y position control, motor_control
#define MAVLINK_SENSOR_PRESENT_DEFAULT (MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_3D_ACCEL | MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE | MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL | MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION | MAV_SYS_STATUS_SENSOR_YAW_POSITION | MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL | MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL | MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS) #define MAVLINK_SENSOR_PRESENT_DEFAULT (MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_3D_ACCEL | MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE | MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL | MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION | MAV_SYS_STATUS_SENSOR_YAW_POSITION | MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL | MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL | MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS)

8
AntennaTracker/Tracker.h

@ -1,11 +1,8 @@
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#define THISFIRMWARE "AntennaTracker V0.7.6"
#define FIRMWARE_VERSION 0,7,6,FIRMWARE_VERSION_TYPE_DEV
/* /*
Lead developers: Matthew Ridley and Andrew Tridgell Lead developers: Matthew Ridley and Andrew Tridgell
Please contribute your ideas! See http://dev.ardupilot.org for details Please contribute your ideas! See http://dev.ardupilot.org for details
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -21,6 +18,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Header includes // Header includes
@ -104,7 +102,7 @@ private:
// has a log download started? // has a log download started?
bool in_log_download = false; bool in_log_download = false;
bool logging_started = false; bool logging_started = false;
DataFlash_Class DataFlash{FIRMWARE_STRING}; DataFlash_Class DataFlash;
AP_GPS gps; AP_GPS gps;

10
AntennaTracker/config.h

@ -76,13 +76,3 @@
MASK_LOG_RCOUT | \ MASK_LOG_RCOUT | \
MASK_LOG_COMPASS MASK_LOG_COMPASS
#endif #endif
/*
build a firmware version string.
GIT_VERSION comes from Makefile builds
*/
#ifndef GIT_VERSION
#define FIRMWARE_STRING THISFIRMWARE
#else
#define FIRMWARE_STRING THISFIRMWARE " (" GIT_VERSION ")"
#endif

1
AntennaTracker/system.cpp

@ -1,6 +1,7 @@
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "Tracker.h" #include "Tracker.h"
#include "version.h"
// mission storage // mission storage
static const StorageAccess wp_storage(StorageManager::StorageMission); static const StorageAccess wp_storage(StorageManager::StorageMission);

10
AntennaTracker/version.h

@ -0,0 +1,10 @@
#pragma once
#define THISFIRMWARE "AntennaTracker V0.7.6"
#define FIRMWARE_VERSION 0,7,6,FIRMWARE_VERSION_TYPE_DEV
#ifndef GIT_VERSION
#define FIRMWARE_STRING THISFIRMWARE
#else
#define FIRMWARE_STRING THISFIRMWARE " (" GIT_VERSION ")"
#endif
Loading…
Cancel
Save