Skip to content
Snippets Groups Projects
Commit 0149312d authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

do not swap buffers if no new data arrived (otherwise the current content would be destroyed)

parent b0add4ba
No related branches found
No related tags found
No related merge requests found
...@@ -166,8 +166,8 @@ namespace ChimeraTK { ...@@ -166,8 +166,8 @@ namespace ChimeraTK {
bool readNonBlocking() { bool readNonBlocking() {
bool ret = impl->readNonBlocking(); bool ret = impl->readNonBlocking();
mtca4u::NDRegisterAccessor<UserType>::buffer_2D[0].swap(impl->accessChannel(0));
if(ret) { if(ret) {
mtca4u::NDRegisterAccessor<UserType>::buffer_2D[0].swap(impl->accessChannel(0));
for(auto &slave : slaves) { // send out copies to slaves for(auto &slave : slaves) { // send out copies to slaves
slave->accessChannel(0) = mtca4u::NDRegisterAccessor<UserType>::buffer_2D[0]; slave->accessChannel(0) = mtca4u::NDRegisterAccessor<UserType>::buffer_2D[0];
slave->write(); slave->write();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment