Browse Source

AP_Button: add and use HAL_BUTTON_ENABLE

gps-1.3.1
Peter Barker 4 years ago committed by Andrew Tridgell
parent
commit
c9fd7ee00d
  1. 5
      libraries/AP_Button/AP_Button.cpp
  2. 10
      libraries/AP_Button/AP_Button.h

5
libraries/AP_Button/AP_Button.cpp

@ -15,6 +15,9 @@ @@ -15,6 +15,9 @@
#include "AP_Button.h"
#if HAL_BUTTON_ENABLED
#include <GCS_MAVLink/GCS_MAVLink.h>
#include <GCS_MAVLink/GCS.h>
@ -400,3 +403,5 @@ AP_Button &button() @@ -400,3 +403,5 @@ AP_Button &button()
}
}
#endif

10
libraries/AP_Button/AP_Button.h

@ -14,6 +14,14 @@ @@ -14,6 +14,14 @@
*/
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_BUTTON_ENABLED
#define HAL_BUTTON_ENABLED 1
#endif
#if HAL_BUTTON_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
@ -127,3 +135,5 @@ private: @@ -127,3 +135,5 @@ private:
namespace AP {
AP_Button &button();
};
#endif

Loading…
Cancel
Save