Browse Source

AP_HAL_Linux: make a static-const hal references references to external symbol

zr-v5.1
Peter Barker 5 years ago committed by Andrew Tridgell
parent
commit
c917cd4dbb
  1. 2
      libraries/AP_HAL_Linux/AnalogIn_Navio2.cpp
  2. 2
      libraries/AP_HAL_Linux/GPIO.cpp
  3. 2
      libraries/AP_HAL_Linux/GPIO_RPI.cpp
  4. 2
      libraries/AP_HAL_Linux/GPIO_Sysfs.cpp
  5. 6
      libraries/AP_HAL_Linux/HAL_Linux_Class.cpp
  6. 4
      libraries/AP_HAL_Linux/I2CDevice.cpp
  7. 2
      libraries/AP_HAL_Linux/Led_Sysfs.cpp
  8. 2
      libraries/AP_HAL_Linux/PWM_Sysfs.cpp
  9. 2
      libraries/AP_HAL_Linux/Perf.cpp
  10. 2
      libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp
  11. 2
      libraries/AP_HAL_Linux/RCOutput_Bebop.cpp
  12. 2
      libraries/AP_HAL_Linux/RCOutput_PCA9685.cpp
  13. 4
      libraries/AP_HAL_Linux/SPIDevice.cpp
  14. 2
      libraries/AP_Notify/RCOutputRGBLed.cpp

2
libraries/AP_HAL_Linux/AnalogIn_Navio2.cpp

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
#include "AnalogIn_Navio2.h"
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
#define ADC_BASE_PATH "/sys/kernel/rcio/adc"

2
libraries/AP_HAL_Linux/GPIO.cpp

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
using namespace Linux;
static const AP_HAL::HAL& hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
DigitalSource::DigitalSource(uint8_t v) :
_v(v)

2
libraries/AP_HAL_Linux/GPIO_RPI.cpp

@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
using namespace Linux;
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
GPIO_RPI::GPIO_RPI()
{

2
libraries/AP_HAL_Linux/GPIO_Sysfs.cpp

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
using namespace Linux;
static const AP_HAL::HAL& hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
#define UINT32_MAX_STR "4294967295"

6
libraries/AP_HAL_Linux/HAL_Linux_Class.cpp

@ -409,14 +409,14 @@ void HAL_Linux::setup_signal_handlers() const @@ -409,14 +409,14 @@ void HAL_Linux::setup_signal_handlers() const
sigaction(SIGINT, &sa, NULL);
}
static HAL_Linux halInstance;
HAL_Linux hal_linux;
void HAL_Linux::exit_signal_handler(int signum)
{
halInstance._should_exit = true;
hal_linux._should_exit = true;
}
const AP_HAL::HAL &AP_HAL::get_HAL()
{
return halInstance;
return hal_linux;
}

4
libraries/AP_HAL_Linux/I2CDevice.cpp

@ -56,9 +56,9 @@ @@ -56,9 +56,9 @@
#define I2C_RDRW_IOCTL_MAX_MSGS 42
#endif
namespace Linux {
extern const AP_HAL::HAL& hal;
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
namespace Linux {
/*
* TODO: move to Util or other upper class to be used by others

2
libraries/AP_HAL_Linux/Led_Sysfs.cpp

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
#include <AP_HAL/AP_HAL.h>
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
namespace Linux {

2
libraries/AP_HAL_Linux/PWM_Sysfs.cpp

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
#include <AP_HAL/AP_HAL.h>
#include <AP_Math/AP_Math.h>
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
namespace Linux {

2
libraries/AP_HAL_Linux/Perf.cpp

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
using namespace Linux;
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
Perf *Perf::_singleton;

2
libraries/AP_HAL_Linux/RCOutput_AeroIO.cpp

@ -91,7 +91,7 @@ using namespace Linux; @@ -91,7 +91,7 @@ using namespace Linux;
* uint16_t duty = 1823;
*/
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
RCOutput_AeroIO::RCOutput_AeroIO()
: _freq_buffer(new uint16_t[PWM_CHAN_COUNT])

2
libraries/AP_HAL_Linux/RCOutput_Bebop.cpp

@ -81,7 +81,7 @@ enum BLDC_STATUS { @@ -81,7 +81,7 @@ enum BLDC_STATUS {
using namespace Linux;
static const AP_HAL::HAL& hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
RCOutput_Bebop::RCOutput_Bebop(AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev)
: _dev(std::move(dev))

2
libraries/AP_HAL_Linux/RCOutput_PCA9685.cpp

@ -54,7 +54,7 @@ using namespace Linux; @@ -54,7 +54,7 @@ using namespace Linux;
#define PWM_CHAN_COUNT 16
static const AP_HAL::HAL& hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
RCOutput_PCA9685::RCOutput_PCA9685(AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev,
bool external_clock,

4
libraries/AP_HAL_Linux/SPIDevice.cpp

@ -39,9 +39,9 @@ @@ -39,9 +39,9 @@
#define DEBUG 0
namespace Linux {
extern const AP_HAL::HAL& hal;
static const AP_HAL::HAL &hal = AP_HAL::get_HAL();
namespace Linux {
#define MHZ (1000U*1000U)
#define KHZ (1000U)

2
libraries/AP_Notify/RCOutputRGBLed.cpp

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
#include <AP_Math/AP_Math.h>
#include <SRV_Channel/SRV_Channel.h>
static const AP_HAL::HAL& hal = AP_HAL::get_HAL();
extern const AP_HAL::HAL& hal;
#define LED_OFF 0
#define LED_FULL_BRIGHT 255

Loading…
Cancel
Save