Browse Source

AP_PiccoloCAN: added selective build of PiccoloCAN

c415-sdk
Andrew Tridgell 5 years ago
parent
commit
9821d52b72
  1. 7
      libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp
  2. 7
      libraries/AP_PiccoloCAN/AP_PiccoloCAN.h

7
libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp

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

7
libraries/AP_PiccoloCAN/AP_PiccoloCAN.h

@ -27,6 +27,11 @@ @@ -27,6 +27,11 @@
#define PICCOLO_CAN_MAX_NUM_ESC 12
#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
{
@ -118,3 +123,5 @@ private: @@ -118,3 +123,5 @@ private:
} _esc_info[PICCOLO_CAN_MAX_NUM_ESC];
};
#endif // HAL_PICCOLO_CAN_ENABLE

Loading…
Cancel
Save