AP_PiccoloCAN: added selective build of PiccoloCAN

This commit is contained in:
Andrew Tridgell 2019-12-09 15:47:42 +11:00
parent ace0006a4e
commit 9821d52b72
2 changed files with 11 additions and 3 deletions

View File

@ -19,10 +19,10 @@
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <AP_AHRS/AP_AHRS.h> #include <AP_AHRS/AP_AHRS.h>
#if HAL_WITH_UAVCAN
#include "AP_PiccoloCAN.h" #include "AP_PiccoloCAN.h"
#if HAL_PICCOLO_CAN_ENABLE
#include <uavcan/uavcan.hpp> #include <uavcan/uavcan.hpp>
#include <uavcan/driver/can.hpp> #include <uavcan/driver/can.hpp>
@ -621,4 +621,5 @@ uint32_t getESCVelocityPacketID(const void* pkt)
} }
#endif // HAL_WITH_UAVCAN #endif // HAL_PICCOLO_CAN_ENABLE

View File

@ -27,6 +27,11 @@
#define PICCOLO_CAN_MAX_NUM_ESC 12 #define PICCOLO_CAN_MAX_NUM_ESC 12
#define PICCOLO_CAN_MAX_GROUP_ESC (PICCOLO_CAN_MAX_NUM_ESC / 4) #define PICCOLO_CAN_MAX_GROUP_ESC (PICCOLO_CAN_MAX_NUM_ESC / 4)
#ifndef HAL_PICCOLO_CAN_ENABLE
#define HAL_PICCOLO_CAN_ENABLE (HAL_WITH_UAVCAN && !HAL_MINIMIZE_FEATURES)
#endif
#if HAL_PICCOLO_CAN_ENABLE
class AP_PiccoloCAN : public AP_HAL::CANProtocol class AP_PiccoloCAN : public AP_HAL::CANProtocol
{ {
@ -118,3 +123,5 @@ private:
} _esc_info[PICCOLO_CAN_MAX_NUM_ESC]; } _esc_info[PICCOLO_CAN_MAX_NUM_ESC];
}; };
#endif // HAL_PICCOLO_CAN_ENABLE