From 4191710febbf8ae426333515604ffa072d06a9a6 Mon Sep 17 00:00:00 2001 From: Riccardo Miccini Date: Thu, 28 May 2015 17:53:19 +0200 Subject: [PATCH 1/4] no data type info provider for TINY --- libuavcan/include/uavcan/node/node.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libuavcan/include/uavcan/node/node.hpp b/libuavcan/include/uavcan/node/node.hpp index 65b478b7a7..ac8ca8b6aa 100644 --- a/libuavcan/include/uavcan/node/node.hpp +++ b/libuavcan/include/uavcan/node/node.hpp @@ -13,10 +13,10 @@ #include // High-level functionality available by default -#include #include #if !UAVCAN_TINY +#include //moved to save space # include # include # include @@ -77,9 +77,9 @@ class UAVCAN_EXPORT Node : public INode OutgoingTransferRegistry outgoing_trans_reg_; Scheduler scheduler_; - DataTypeInfoProvider proto_dtp_; NodeStatusProvider proto_nsp_; #if !UAVCAN_TINY + DataTypeInfoProvider proto_dtp_; // moved to save space Logger proto_logger_; RestartRequestServer proto_rrs_; TransportStatsProvider proto_tsp_; @@ -106,9 +106,9 @@ public: Node(ICanDriver& can_driver, ISystemClock& system_clock) : outgoing_trans_reg_(pool_allocator_) , scheduler_(can_driver, pool_allocator_, system_clock, outgoing_trans_reg_) - , proto_dtp_(*this) , proto_nsp_(*this) #if !UAVCAN_TINY + , proto_dtp_(*this) // moved , proto_logger_(*this) , proto_rrs_(*this) , proto_tsp_(*this) @@ -277,17 +277,17 @@ int Node Date: Thu, 28 May 2015 18:00:03 +0200 Subject: [PATCH 2/4] no data type info provider for TINY --- libuavcan/include/uavcan/node/node.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libuavcan/include/uavcan/node/node.hpp b/libuavcan/include/uavcan/node/node.hpp index ac8ca8b6aa..878a365082 100644 --- a/libuavcan/include/uavcan/node/node.hpp +++ b/libuavcan/include/uavcan/node/node.hpp @@ -16,7 +16,7 @@ #include #if !UAVCAN_TINY -#include //moved to save space +#include # include # include # include @@ -79,7 +79,7 @@ class UAVCAN_EXPORT Node : public INode NodeStatusProvider proto_nsp_; #if !UAVCAN_TINY - DataTypeInfoProvider proto_dtp_; // moved to save space + DataTypeInfoProvider proto_dtp_; Logger proto_logger_; RestartRequestServer proto_rrs_; TransportStatsProvider proto_tsp_; @@ -108,7 +108,7 @@ public: , scheduler_(can_driver, pool_allocator_, system_clock, outgoing_trans_reg_) , proto_nsp_(*this) #if !UAVCAN_TINY - , proto_dtp_(*this) // moved + , proto_dtp_(*this) , proto_logger_(*this) , proto_rrs_(*this) , proto_tsp_(*this) @@ -283,7 +283,7 @@ int Node Date: Thu, 28 May 2015 18:10:42 +0200 Subject: [PATCH 3/4] no data type info provider for TINY --- libuavcan/include/uavcan/node/node.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libuavcan/include/uavcan/node/node.hpp b/libuavcan/include/uavcan/node/node.hpp index 878a365082..0197241f62 100644 --- a/libuavcan/include/uavcan/node/node.hpp +++ b/libuavcan/include/uavcan/node/node.hpp @@ -16,7 +16,7 @@ #include #if !UAVCAN_TINY -#include +# include # include # include # include From fe3fce49964e147aed27a2159286435c80844294 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 29 May 2015 03:34:37 +0300 Subject: [PATCH 4/4] CanIOManager::makePendingTxMask() made public --- libuavcan/include/uavcan/transport/can_io.hpp | 3 ++- libuavcan/src/transport/uc_can_io.cpp | 26 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/libuavcan/include/uavcan/transport/can_io.hpp b/libuavcan/include/uavcan/transport/can_io.hpp index 867407d056..0cc4e79761 100644 --- a/libuavcan/include/uavcan/transport/can_io.hpp +++ b/libuavcan/include/uavcan/transport/can_io.hpp @@ -154,7 +154,6 @@ class UAVCAN_EXPORT CanIOManager : Noncopyable int sendToIface(uint8_t iface_index, const CanFrame& frame, MonotonicTime tx_deadline, CanIOFlags flags); int sendFromTxQueue(uint8_t iface_index); - uint8_t makePendingTxMask() const; int callSelect(CanSelectMasks& inout_masks, MonotonicTime blocking_deadline); public: @@ -168,6 +167,8 @@ public: const ICanDriver& getCanDriver() const { return driver_; } ICanDriver& getCanDriver() { return driver_; } + uint8_t makePendingTxMask() const; + /** * Returns: * 0 - rejected/timedout/enqueued diff --git a/libuavcan/src/transport/uc_can_io.cpp b/libuavcan/src/transport/uc_can_io.cpp index 0195eb2280..210ea3822e 100644 --- a/libuavcan/src/transport/uc_can_io.cpp +++ b/libuavcan/src/transport/uc_can_io.cpp @@ -261,19 +261,6 @@ int CanIOManager::sendFromTxQueue(uint8_t iface_index) return res; } -uint8_t CanIOManager::makePendingTxMask() const -{ - uint8_t write_mask = 0; - for (uint8_t i = 0; i < getNumIfaces(); i++) - { - if (!tx_queues_[i]->isEmpty()) - { - write_mask |= uint8_t(1 << i); - } - } - return write_mask; -} - int CanIOManager::callSelect(CanSelectMasks& inout_masks, MonotonicTime blocking_deadline) { const CanSelectMasks in_masks = inout_masks; @@ -312,6 +299,19 @@ CanIOManager::CanIOManager(ICanDriver& driver, IPoolAllocator& allocator, ISyste } } +uint8_t CanIOManager::makePendingTxMask() const +{ + uint8_t write_mask = 0; + for (uint8_t i = 0; i < getNumIfaces(); i++) + { + if (!tx_queues_[i]->isEmpty()) + { + write_mask |= uint8_t(1 << i); + } + } + return write_mask; +} + CanIfacePerfCounters CanIOManager::getIfacePerfCounters(uint8_t iface_index) const { ICanIface* const iface = driver_.getIface(iface_index);