Browse Source

AP_ADSB: conditionally compile based on HAL_ADSB_ENABLED

c415-sdk
Andy Piper 4 years ago committed by Andrew Tridgell
parent
commit
465357e715
  1. 4
      libraries/AP_ADSB/AP_ADSB.cpp
  2. 10
      libraries/AP_ADSB/AP_ADSB.h
  3. 3
      libraries/AP_ADSB/AP_ADSB_Backend.cpp
  4. 4
      libraries/AP_ADSB/AP_ADSB_Backend.h
  5. 3
      libraries/AP_ADSB/AP_ADSB_MAVLink.cpp
  6. 4
      libraries/AP_ADSB/AP_ADSB_MAVLink.h
  7. 5
      libraries/AP_ADSB/AP_ADSB_Sagetech.cpp
  8. 3
      libraries/AP_ADSB/AP_ADSB_Sagetech.h

4
libraries/AP_ADSB/AP_ADSB.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
*/
#include "AP_ADSB.h"
#if HAL_ADSB_ENABLED
#include "AP_ADSB_Sagetech.h"
#include "AP_ADSB_MAVLink.h"
#include <stdio.h> // for sprintf
@ -833,3 +834,6 @@ AP_ADSB *AP::ADSB() @@ -833,3 +834,6 @@ AP_ADSB *AP::ADSB()
return AP_ADSB::get_singleton();
}
#endif // HAL_ADSB_ENABLED

10
libraries/AP_ADSB/AP_ADSB.h

@ -22,11 +22,18 @@ @@ -22,11 +22,18 @@
*/
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Common/AP_Common.h>
#include <AP_Param/AP_Param.h>
#include <AP_Common/Location.h>
#include <GCS_MAVLink/GCS_MAVLink.h>
#ifndef HAL_ADSB_ENABLED
#define HAL_ADSB_ENABLED !HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024
#endif
#if HAL_ADSB_ENABLED
#define ADSB_BITBASK_RF_CAPABILITIES_UAT_IN (1 << 0)
#define ADSB_BITBASK_RF_CAPABILITIES_1090ES_IN (1 << 1)
@ -222,3 +229,6 @@ private: @@ -222,3 +229,6 @@ private:
namespace AP {
AP_ADSB *ADSB();
};
#endif // HAL_ADSB_ENABLED

3
libraries/AP_ADSB/AP_ADSB_Backend.cpp

@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
#include "AP_ADSB_Backend.h"
#if HAL_ADSB_ENABLED
/*
base class constructor.
This incorporates initialisation as well.
@ -24,3 +25,5 @@ AP_ADSB_Backend::AP_ADSB_Backend(AP_ADSB &_frontend) : @@ -24,3 +25,5 @@ AP_ADSB_Backend::AP_ADSB_Backend(AP_ADSB &_frontend) :
{
}
#endif // HAL_ADSB_ENABLED

4
libraries/AP_ADSB/AP_ADSB_Backend.h

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
#include "AP_ADSB.h"
#if HAL_ADSB_ENABLED
class AP_ADSB_Backend
{
public:
@ -41,3 +43,5 @@ protected: @@ -41,3 +43,5 @@ protected:
private:
};
#endif // HAL_ADSB_ENABLED

3
libraries/AP_ADSB/AP_ADSB_MAVLink.cpp

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
#include "AP_ADSB_MAVLink.h"
#if HAL_ADSB_ENABLED
#include <limits.h>
#include <AP_Vehicle/AP_Vehicle.h>
#include <GCS_MAVLink/GCS.h>
@ -274,3 +276,4 @@ uint32_t AP_ADSB_MAVLink::get_encoded_icao(void) @@ -274,3 +276,4 @@ uint32_t AP_ADSB_MAVLink::get_encoded_icao(void)
return encoded_icao;
}
#endif // HAL_ADSB_ENABLED

4
libraries/AP_ADSB/AP_ADSB_MAVLink.h

@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
#include "AP_ADSB_Backend.h"
#if HAL_ADSB_ENABLED
class AP_ADSB_MAVLink : public AP_ADSB_Backend {
public:
// constructor
@ -44,3 +46,5 @@ private: @@ -44,3 +46,5 @@ private:
int8_t _chan = -1;
};
#endif // HAL_ADSB_ENABLED

5
libraries/AP_ADSB/AP_ADSB_Sagetech.cpp

@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
*/
#include "AP_ADSB_Sagetech.h"
#if HAL_ADSB_ENABLED
#include <GCS_MAVLink/GCS.h>
#include <AP_AHRS/AP_AHRS.h>
#include <AP_RTC/AP_RTC.h>
@ -748,4 +751,6 @@ const char* AP_ADSB_Sagetech::systemStatsBits_to_str(const SystemStateBits syste @@ -748,4 +751,6 @@ const char* AP_ADSB_Sagetech::systemStatsBits_to_str(const SystemStateBits syste
}
}
#endif // HAL_ADSB_ENABLED

3
libraries/AP_ADSB/AP_ADSB_Sagetech.h

@ -17,6 +17,8 @@ @@ -17,6 +17,8 @@
#include "AP_ADSB_Backend.h"
#if HAL_ADSB_ENABLED
class AP_ADSB_Sagetech : public AP_ADSB_Backend {
public:
// constructor
@ -148,3 +150,4 @@ private: @@ -148,3 +150,4 @@ private:
Transponder_Type transponder_type = Transponder_Type::Unknown;
};
#endif // HAL_ADSB_ENABLED

Loading…
Cancel
Save