Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop creating firmware version objects in GCS_Dummy #26545

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e5ca5fa
AP_Common: provide ExampleFirmwareVersion for examples etc to use
peterbarker Mar 16, 2024
5046994
GCS_MAVLink: stop supplying FWVersion object as part of GCS_Dummy
peterbarker Mar 16, 2024
94b057d
AP_AHRS: get firmware version object from AP_Common
peterbarker Mar 17, 2024
7d40d4f
AP_Airspeed: get firmware version object from AP_Common
peterbarker Mar 17, 2024
5c4ac7d
AP_Baro: get firmware version object from AP_Common
peterbarker Mar 17, 2024
4af641c
AP_Common: get firmware version object from AP_Common
peterbarker Mar 17, 2024
c7d039b
AP_FlashIface: get firmware version object from AP_Common
peterbarker Mar 17, 2024
42048aa
AP_GPS: get firmware version object from AP_Common
peterbarker Mar 17, 2024
b9065de
AP_GyroFFT: get firmware version object from AP_Common
peterbarker Mar 17, 2024
3658953
AP_HAL: get firmware version object from AP_Common
peterbarker Mar 17, 2024
b60a0b2
AP_InertialSensor: get firmware version object from AP_Common
peterbarker Mar 17, 2024
9bc51bc
AP_Logger: get firmware version object from AP_Common
peterbarker Mar 17, 2024
520fa3e
AP_Mission: get firmware version object from AP_Common
peterbarker Mar 17, 2024
4aab1c0
AP_Module: get firmware version object from AP_Common
peterbarker Mar 17, 2024
abc280d
AP_NMEA_Output: get firmware version object from AP_Common
peterbarker Mar 17, 2024
0d5bd75
AP_RangeFinder: get firmware version object from AP_Common
peterbarker Mar 17, 2024
6d18848
AP_RTC: get firmware version object from AP_Common
peterbarker Mar 17, 2024
ba4fa62
AP_Scheduler: get firmware version object from AP_Common
peterbarker Mar 17, 2024
3847eff
GCS_MAVLink: get firmware version object from AP_Common
peterbarker Mar 17, 2024
d0f944c
Tools: get firmware version object from AP_Common
peterbarker Mar 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Tools/Replay/Replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <AP_Filesystem/posix_compat.h>
#include <AP_AdvancedFailsafe/AP_AdvancedFailsafe.h>

#include <AP_Common/ExampleFirmwareVersion.h>

#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
#include <AP_HAL_Linux/Scheduler.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
#include <AP_Vehicle/AP_Vehicle.h>

#include <AP_Common/ExampleFirmwareVersion.h>

void setup();
void loop();

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Airspeed/examples/Airspeed/Airspeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <AP_BoardConfig/AP_BoardConfig.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

void setup();
void loop();

Expand Down
1 change: 1 addition & 0 deletions libraries/AP_Baro/examples/BARO_generic/BARO_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL &hal = AP_HAL::get_HAL();

Expand Down
26 changes: 26 additions & 0 deletions libraries/AP_Common/ExampleFirmwareVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once

/*
this is a file intended to be included by examples and other tools
which need to make the firmware version defines but really don't
care how that is done.

it is intended to be included in a .cpp file, never transitively, as
it does create objects.
*/

#define THISFIRMWARE "GCSDummy V3.1.4-dev"

#define FW_MAJOR 3
#define FW_MINOR 1
#define FW_PATCH 4
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV

#ifndef APM_BUILD_DIRECTORY
#define APM_BUILD_DIRECTORY APM_BUILD_UNKNOWN
#endif

#define FORCE_VERSION_H_INCLUDE
#include <AP_Common/AP_FWVersionDefine.h>
#include <AP_CheckFirmware/AP_CheckFirmwareDefine.h>
#undef FORCE_VERSION_H_INCLUDE
2 changes: 2 additions & 0 deletions libraries/AP_Common/tests/test_fwversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <AP_Vehicle/AP_Vehicle_Type.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL& hal = AP_HAL::get_HAL();


Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Common/tests/test_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <AP_Terrain/AP_Terrain.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL& hal = AP_HAL::get_HAL();

class DummyVehicle {
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_FlashIface/examples/jedec_test/jedec_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ void loop()
#include <AP_FlashIface/AP_FlashIface.h>
#include <stdio.h>

#include <AP_Common/ExampleFirmwareVersion.h>

AP_FlashIface_JEDEC jedec_dev;
const AP_HAL::HAL& hal = AP_HAL::get_HAL();

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_GPS/examples/GPS_AUTO_test/GPS_AUTO_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <SITL/SITL.h>
#include <AP_Scheduler/AP_Scheduler.h>

#include <AP_Common/ExampleFirmwareVersion.h>

void setup(); //This function is defined in most of the libraries. This function is called only once at boot up time. This function is called by main() function in HAL.
void loop(); //This function is defined in most of the libraries. This function is called by main function in HAL. The main work of the sketch is typically in this function only.

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_GyroFFT/examples/ReplayGyroFFT/ReplayGyroFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <AP_Arming/AP_Arming.h>
#include <SITL/SITL.h>

#include <AP_Common/ExampleFirmwareVersion.h>

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
const AP_HAL::HAL &hal = AP_HAL::get_HAL();

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_HAL/examples/DSP_test/DSP_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <AP_Logger/AP_Logger.h>
#include "GyroFrame.h"

#include <AP_Common/ExampleFirmwareVersion.h>

#if HAL_WITH_DSP
const AP_HAL::HAL &hal = AP_HAL::get_HAL();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <AP_Logger/AP_Logger.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL &hal = AP_HAL::get_HAL();

static AP_InertialSensor ins;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <stdio.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL& hal = AP_HAL::get_HAL();

// Format characters in the format string for binary log messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <stdio.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL& hal = AP_HAL::get_HAL();

#define LOG_TEST_MSG 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <AP_AHRS/AP_AHRS_DCM.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const AP_HAL::HAL& hal = AP_HAL::get_HAL();

const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Module/examples/ModuleTest/ModuleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <AP_ExternalAHRS/AP_ExternalAHRS.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
AP_GROUPEND
};
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_NMEA_Output/examples/NMEA_Output/nmea_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <AP_SerialManager/AP_SerialManager.h>
#include <AP_Vehicle/AP_Vehicle.h>

#include <AP_Common/ExampleFirmwareVersion.h>

void setup();
void loop();

Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_RTC/examples/RTC_test/RTC_Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <AP_Logger/AP_Logger.h>

#include <AP_Common/ExampleFirmwareVersion.h>

#include <stdio.h>

void setup();
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_RangeFinder/examples/RFIND_test/RFIND_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <AP_RangeFinder/AP_RangeFinder_Backend.h>
#include <GCS_MAVLink/GCS_Dummy.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
AP_GROUPEND
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <GCS_MAVLink/GCS_Dummy.h>
#include <stdio.h>

#include <AP_Common/ExampleFirmwareVersion.h>

const struct AP_Param::GroupInfo GCS_MAVLINK_Parameters::var_info[] = {
AP_GROUPEND
};
Expand Down
6 changes: 1 addition & 5 deletions libraries/GCS_MAVLink/GCS_Dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
#if HAL_GCS_ENABLED

#include "GCS_Dummy.h"
#include <AP_Vehicle/AP_Vehicle_Type.h>

#include <stdio.h>

#define FORCE_VERSION_H_INCLUDE
#include <AP_Common/AP_FWVersionDefine.h>
#include <AP_CheckFirmware/AP_CheckFirmwareDefine.h>
#undef FORCE_VERSION_H_INCLUDE

const struct GCS_MAVLINK::stream_entries GCS_MAVLINK::all_stream_entries[] {};

/*
Expand Down
8 changes: 0 additions & 8 deletions libraries/GCS_MAVLink/GCS_Dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
#if HAL_GCS_ENABLED

#include "GCS.h"
#include <AP_Common/AP_FWVersion.h>

#define THISFIRMWARE "GCSDummy V3.1.4-dev"

#define FW_MAJOR 3
#define FW_MINOR 1
#define FW_PATCH 4
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV

/*
* GCS backend used for many examples and tools
Expand Down
2 changes: 2 additions & 0 deletions libraries/GCS_MAVLink/examples/routing/routing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <AP_Common/AP_FWVersion.h>
#include <AP_SerialManager/AP_SerialManager.h>

#include <AP_Common/ExampleFirmwareVersion.h>

void setup();
void loop();

Expand Down
Loading