Merge branch 'dynamic_node_id_raft' into global_rx_object_buffer

This commit is contained in:
Pavel Kirienko
2015-05-29 17:47:07 +03:00
3 changed files with 23 additions and 22 deletions
+8 -8
View File
@@ -13,10 +13,10 @@
#include <uavcan/node/marshal_buffer.hpp>
// High-level functionality available by default
#include <uavcan/protocol/data_type_info_provider.hpp>
#include <uavcan/protocol/node_status_provider.hpp>
#if !UAVCAN_TINY
# include <uavcan/protocol/data_type_info_provider.hpp>
# include <uavcan/protocol/logger.hpp>
# include <uavcan/protocol/restart_request_server.hpp>
# include <uavcan/protocol/transport_stats_provider.hpp>
@@ -80,9 +80,9 @@ class UAVCAN_EXPORT Node : public INode
OutgoingTransferRegistry<OutgoingTransferRegistryStaticEntries> outgoing_trans_reg_;
Scheduler scheduler_;
DataTypeInfoProvider proto_dtp_;
NodeStatusProvider proto_nsp_;
#if !UAVCAN_TINY
DataTypeInfoProvider proto_dtp_;
Logger proto_logger_;
RestartRequestServer proto_rrs_;
TransportStatsProvider proto_tsp_;
@@ -109,9 +109,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)
, proto_logger_(*this)
, proto_rrs_(*this)
, proto_tsp_(*this)
@@ -279,17 +279,17 @@ int Node<MemPoolSize_, OutgoingTransferRegistryStaticEntries, MarshalBufferSize>
GlobalDataTypeRegistry::instance().freeze();
int res = 0;
res = proto_dtp_.start();
if (res < 0)
{
goto fail;
}
res = proto_nsp_.startAndPublish(priority);
if (res < 0)
{
goto fail;
}
#if !UAVCAN_TINY
res = proto_dtp_.start();
if (res < 0)
{
goto fail;
}
res = proto_logger_.init();
if (res < 0)
{
@@ -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
+13 -13
View File
@@ -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);