All unit tests compile, but crash. This is the most horrifying commit I've ever made.

This commit is contained in:
Pavel Kirienko
2015-07-01 14:55:24 +03:00
parent feb7600f17
commit 8a2e22046e
42 changed files with 421 additions and 587 deletions
@@ -46,14 +46,14 @@ class UAVCAN_EXPORT GlobalTimeSyncMaster : protected LoopbackFrameListenerBase
UAVCAN_ASSERT(iface_index < MaxCanIfaces);
}
int init()
int init(TransferPriority priority = TransferPriority::OneLowerThanHighest)
{
const int res = pub_.init();
if (res >= 0)
{
pub_.getTransferSender().setIfaceMask(uint8_t(1 << iface_index_));
pub_.getTransferSender().setCanIOFlags(CanIOFlagLoopback);
pub_.setPriority(TransferPriorityHigh); // Fixed priority
pub_.setPriority(priority);
}
return res;
}
@@ -109,7 +109,7 @@ class UAVCAN_EXPORT GlobalTimeSyncMaster : protected LoopbackFrameListenerBase
{
if (frame.getDataTypeID() == dtid_ &&
frame.getTransferType() == TransferTypeMessageBroadcast &&
frame.isLast() && frame.isFirst() &&
frame.isStartOfTransfer() && frame.isEndOfTransfer() &&
frame.getSrcNodeID() == node_.getNodeID())
{
iface_masters_[iface]->setTxTimestamp(frame.getUtcTimestamp());