Browse Source

AP_Proximity: move to config.h pattern and only include log structures if enabled

apm_2208
Iampete1 3 years ago committed by Andrew Tridgell
parent
commit
68b7293d9a
  1. 6
      libraries/AP_Proximity/AP_Proximity.h
  2. 7
      libraries/AP_Proximity/AP_Proximity_config.h
  3. 5
      libraries/AP_Proximity/LogStructure.h

6
libraries/AP_Proximity/AP_Proximity.h

@ -14,11 +14,7 @@ @@ -14,11 +14,7 @@
*/
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_PROXIMITY_ENABLED
#define HAL_PROXIMITY_ENABLED (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif
#include "AP_Proximity_config.h"
#if HAL_PROXIMITY_ENABLED

7
libraries/AP_Proximity/AP_Proximity_config.h

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_PROXIMITY_ENABLED
#define HAL_PROXIMITY_ENABLED (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif

5
libraries/AP_Proximity/LogStructure.h

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
#pragma once
#include <AP_Logger/LogStructure.h>
#include "AP_Proximity_config.h"
#define LOG_IDS_FROM_PROXIMITY \
LOG_PROXIMITY_MSG, \
@ -70,8 +71,12 @@ struct PACKED log_Proximity_raw { @@ -70,8 +71,12 @@ struct PACKED log_Proximity_raw {
};
#if HAL_PROXIMITY_ENABLED
#define LOG_STRUCTURE_FROM_PROXIMITY \
{ LOG_PROXIMITY_MSG, sizeof(log_Proximity), \
"PRX", "QBBfffffffffff", "TimeUS,Layer,He,D0,D45,D90,D135,D180,D225,D270,D315,DUp,CAn,CDis", "s#-mmmmmmmmmhm", "F--00000000000", true }, \
{ LOG_RAW_PROXIMITY_MSG, sizeof(log_Proximity_raw), \
"PRXR", "QBffffffff", "TimeUS,Layer,D0,D45,D90,D135,D180,D225,D270,D315", "s#mmmmmmmm", "F-00000000", true },
#else
#define LOG_STRUCTURE_FROM_PROXIMITY
#endif

Loading…
Cancel
Save