mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 15:33:34 +08:00
Using UAVCAN_PACKED_BEGIN/UAVCAN_PACKED_END macros globally
This commit is contained in:
@@ -15,7 +15,7 @@ namespace uavcan
|
||||
/**
|
||||
* Raw CAN frame, as passed to/from the CAN driver.
|
||||
*/
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
struct CanFrame
|
||||
{
|
||||
static const uint32_t MaskStdID = 0x000007FF;
|
||||
@@ -65,7 +65,7 @@ struct CanFrame
|
||||
return (id & CanFrame::MaskExtID) > (rhs.id & CanFrame::MaskExtID);
|
||||
}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
/**
|
||||
* CAN hardware filter config struct. @ref ICanDriver::filter().
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace uavcan
|
||||
template <typename Key, typename Value, unsigned int NumStaticEntries>
|
||||
class Map : Noncopyable
|
||||
{
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
struct KVPair
|
||||
{
|
||||
Key key;
|
||||
@@ -72,7 +72,7 @@ class Map : Noncopyable
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
LinkedListRoot<KVGroup> list_;
|
||||
IAllocator& allocator_;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
class OutgoingTransferRegistryKey
|
||||
{
|
||||
uint16_t data_type_id_;
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
(destination_node_id_ == rhs.destination_node_id_);
|
||||
}
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
|
||||
class IOutgoingTransferRegistry
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
template <int NumStaticEntries>
|
||||
class OutgoingTransferRegistry : public IOutgoingTransferRegistry, Noncopyable
|
||||
{
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
struct Value
|
||||
{
|
||||
uint64_t monotonic_deadline;
|
||||
TransferID tid;
|
||||
Value() : monotonic_deadline(0) { }
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
class DeadlineExpiredPredicate
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
/**
|
||||
* API for transfer buffer users.
|
||||
*/
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
int read(unsigned int offset, uint8_t* data, unsigned int len) const;
|
||||
int write(unsigned int offset, const uint8_t* data, unsigned int len);
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
/**
|
||||
* Standalone static buffer
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
#pragma pack(push, 1)
|
||||
UAVCAN_PACKED_BEGIN
|
||||
class TransferReceiver
|
||||
{
|
||||
public:
|
||||
@@ -69,6 +69,6 @@ public:
|
||||
|
||||
uint32_t getInterval() const { return transfer_interval_; }
|
||||
};
|
||||
#pragma pack(pop)
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user