From 18d86898b4d4618c03e36a2448f85726bbf61c64 Mon Sep 17 00:00:00 2001 From: Kostas Alexopoulos Date: Wed, 21 Oct 2020 15:30:03 +0200 Subject: [PATCH] [crorc] Further fortify link assertion --- src/Crorc/CrorcBar.cxx | 1 - src/Crorc/CrorcDmaChannel.cxx | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Crorc/CrorcBar.cxx b/src/Crorc/CrorcBar.cxx index d5de99f3..d4a6a631 100644 --- a/src/Crorc/CrorcBar.cxx +++ b/src/Crorc/CrorcBar.cxx @@ -166,7 +166,6 @@ void CrorcBar::assertLinkUp() } } - std::this_thread::sleep_for(500ms); if (!checkLinkUp()) { BOOST_THROW_EXCEPTION(CrorcCheckLinkException() << ErrorInfo::Message("Link was not up")); } diff --git a/src/Crorc/CrorcDmaChannel.cxx b/src/Crorc/CrorcDmaChannel.cxx index 8f7b59c0..2453c2fd 100644 --- a/src/Crorc/CrorcDmaChannel.cxx +++ b/src/Crorc/CrorcDmaChannel.cxx @@ -93,6 +93,12 @@ CrorcDmaChannel::CrorcDmaChannel(const Parameters& parameters) getReadyFifoUser()->reset(); mDmaBufferUserspace = getBufferProvider().getAddress(); + + if (mDataSource == DataSource::Fee || mDataSource == DataSource::Siu) { + deviceResetChannel(ResetLevel::InternalSiu); + } else { + deviceResetChannel(ResetLevel::Internal); + } } auto CrorcDmaChannel::allowedChannels() -> AllowedChannels @@ -106,11 +112,7 @@ CrorcDmaChannel::~CrorcDmaChannel() void CrorcDmaChannel::deviceStartDma() { - if (mDataSource == DataSource::Fee || mDataSource == DataSource::Siu) { - deviceResetChannel(ResetLevel::InternalSiu); - } else { - deviceResetChannel(ResetLevel::Internal); - } + deviceResetChannel(ResetLevel::Internal); startDataReceiving();