mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 15:23:57 -04:00
AP_RangeFinder: create a AP_RANGEFINDER_BACKEND_CAN_ENABLED
avoid cmpilation problems when rangefinder not enabled but CAN is
This commit is contained in:
parent
c40b1627dd
commit
118f3b41ac
@ -13,11 +13,13 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AP_RangeFinder_config.h"
|
||||
|
||||
#if AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include "AP_RangeFinder_Backend_CAN.h"
|
||||
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
|
||||
const AP_Param::GroupInfo AP_RangeFinder_Backend_CAN::var_info[] = {
|
||||
|
||||
// @Param: RECV_ID
|
||||
@ -87,4 +89,4 @@ bool AP_RangeFinder_Backend_CAN::is_correct_id(uint32_t id) const
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
#endif // AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
|
@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "AP_RangeFinder_config.h"
|
||||
|
||||
#if AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
|
||||
#include "AP_RangeFinder_Backend.h"
|
||||
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
|
||||
#include <AP_CANManager/AP_CANSensor.h>
|
||||
#include <AP_BoardConfig/AP_BoardConfig.h>
|
||||
|
||||
@ -61,4 +62,4 @@ private:
|
||||
uint32_t _distance_count;
|
||||
};
|
||||
|
||||
#endif // HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
#endif // AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
|
@ -15,6 +15,10 @@
|
||||
#define AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED AP_RANGEFINDER_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
#define AP_RANGEFINDER_BACKEND_CAN_ENABLED AP_RANGEFINDER_ENABLED && HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_ANALOG_ENABLED
|
||||
#define AP_RANGEFINDER_ANALOG_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED
|
||||
#endif
|
||||
@ -148,7 +152,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_TOFSENSEP_CAN_ENABLED
|
||||
#define AP_RANGEFINDER_TOFSENSEP_CAN_ENABLED (HAL_MAX_CAN_PROTOCOL_DRIVERS && AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED)
|
||||
#define AP_RANGEFINDER_TOFSENSEP_CAN_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_TOFSENSEF_I2C_ENABLED
|
||||
@ -160,7 +164,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_USD1_CAN_ENABLED
|
||||
#define AP_RANGEFINDER_USD1_CAN_ENABLED (HAL_MAX_CAN_PROTOCOL_DRIVERS && AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED)
|
||||
#define AP_RANGEFINDER_USD1_CAN_ENABLED AP_RANGEFINDER_BACKEND_DEFAULT_ENABLED && AP_RANGEFINDER_BACKEND_CAN_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_RANGEFINDER_USD1_SERIAL_ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user