mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 01:13:35 +08:00
UAVCAN_TINY preprocessor option - STM32 test compiles into 41kB in release mode (-Os, LTO)
This commit is contained in:
@@ -10,6 +10,22 @@
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
#if UAVCAN_TINY
|
||||
|
||||
class UAVCAN_EXPORT TransferPerfCounter
|
||||
{
|
||||
public:
|
||||
void addTxTransfer() { }
|
||||
void addRxTransfer() { }
|
||||
void addError() { }
|
||||
void addErrors(unsigned) { }
|
||||
uint64_t getTxTransferCount() const { return 0; }
|
||||
uint64_t getRxTransferCount() const { return 0; }
|
||||
uint64_t getErrorCount() const { return 0; }
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
class UAVCAN_EXPORT TransferPerfCounter
|
||||
{
|
||||
uint64_t transfers_tx_;
|
||||
@@ -38,4 +54,6 @@ public:
|
||||
uint64_t getErrorCount() const { return errors_; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user