mirror of https://github.com/ArduPilot/ardupilot
AP_CANManager: Use HAL_CANMANAGER_ENABLED instead of HAL_ENABLE_LIBUAVCAN_DRIVERS
This commit is contained in:
parent
47b0ac663a
commit
603b302ffd
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS && HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS && HAL_CANMANAGER_ENABLED
|
||||
#include "AP_CANManager.h"
|
||||
#include <AP_Vehicle/AP_Vehicle.h>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_CANMANAGER_ENABLED
|
||||
#include "AP_CANManager.h"
|
||||
|
||||
// table of user settable CAN bus parameters
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <AP_Common/AP_Common.h>
|
||||
#include "AP_CANManager.h"
|
||||
|
||||
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_CANMANAGER_ENABLED
|
||||
|
||||
#include <AP_Vehicle/AP_Vehicle.h>
|
||||
#include <AP_UAVCAN/AP_UAVCAN.h>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
|
||||
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_CANMANAGER_ENABLED
|
||||
#define debug_can(level_debug, fmt, args...) do { AP::can().log_text(level_debug, _driver_name, fmt, ##args); } while (0)
|
||||
#else
|
||||
#define debug_can(level_debug, fmt, args...)
|
||||
|
@ -34,7 +34,7 @@ CANSensor::CANSensor(const char *driver_name, AP_CANManager::Driver_Type dtype,
|
|||
_driver_name(driver_name),
|
||||
_stack_size(stack_size)
|
||||
{
|
||||
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_CANMANAGER_ENABLED
|
||||
if (!AP::can().register_driver(dtype, this)) {
|
||||
debug_can(AP_CANManager::LOG_ERROR, "Failed to register CANSensor %s", driver_name);
|
||||
} else {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <AP_Common/AP_Common.h>
|
||||
|
||||
#include "AP_CANManager.h"
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_CANMANAGER_ENABLED
|
||||
#include "AP_CANTester.h"
|
||||
#include <AP_SerialManager/AP_SerialManager.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "AP_CANDriver.h"
|
||||
#include <AP_HAL/Semaphores.h>
|
||||
#include <AP_UAVCAN/AP_UAVCAN.h>
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_CANMANAGER_ENABLED
|
||||
|
||||
class CANTester : public AP_CANDriver
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <AP_HAL/AP_HAL.h>
|
||||
#include <AP_Common/AP_Common.h>
|
||||
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS > 1 && !HAL_MINIMIZE_FEATURES && HAL_CANMANAGER_ENABLED
|
||||
#include "AP_CANTester_KDECAN.h"
|
||||
#include "AP_CANManager.h"
|
||||
#include <AP_Math/AP_Math.h>
|
||||
|
|
|
@ -245,7 +245,7 @@ bool SLCAN::CANIface::init_passthrough(uint8_t i)
|
|||
_can_iface = hal.can[i];
|
||||
_iface_num = _slcan_can_port - 1;
|
||||
_prev_ser_port = -1;
|
||||
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||
#if HAL_CANMANAGER_ENABLED
|
||||
AP::can().log_text(AP_CANManager::LOG_INFO, LOG_TAG, "Setting SLCAN Passthrough for CAN%d\n", _slcan_can_port - 1);
|
||||
#endif
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue