mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
uldaq: fix buffering issue
This commit is contained in:
parent
29f3b23eb3
commit
fe69d015f0
1 changed files with 1 additions and 2 deletions
|
@ -607,14 +607,13 @@ int uldaq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *r
|
|||
|
||||
pthread_mutex_lock(&u->in.mutex);
|
||||
|
||||
|
||||
if (u->in.status != SS_RUNNING)
|
||||
return -1;
|
||||
|
||||
size_t start_index = u->in.buffer_pos;
|
||||
|
||||
/* Wait for data available condition triggered by event callback */
|
||||
if (start_index + n->in.vectorize * u->in.channel_count > u->in.transfer_status.currentScanCount)
|
||||
if (start_index + n->in.vectorize * u->in.channel_count > u->in.transfer_status.currentTotalCount)
|
||||
pthread_cond_wait(&u->in.cv, &u->in.mutex);
|
||||
|
||||
for (unsigned j = 0; j < cnt; j++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue