1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Merge branch 'develop' of git.rwth-aachen.de:acs/public/villas/VILLASnode into develop

This commit is contained in:
Steffen Vogel 2019-03-08 13:16:16 +01:00
commit e7c72d648c
4 changed files with 9 additions and 17 deletions

View file

@ -37,7 +37,7 @@ nodes = {
},
out = {
vectorize = 100
address = "192.168.104.10:13000"
address = "10.100.1.125:13000"
}
}
}

View file

@ -31,7 +31,7 @@
#include <villas/sample.h>
struct average {
int mask;
uint64_t mask;
int offset;
};
@ -42,7 +42,7 @@ static int average_parse(struct hook *h, json_t *cfg)
int ret;
json_error_t err;
ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s: i }",
ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s: I }",
"offset", &p->offset,
"mask", &p->mask
);
@ -62,7 +62,7 @@ static int average_process(struct hook *h, struct sample *smps[], unsigned *cnt)
int n = 0;
for (int k = 0; k < smp->length; k++) {
if (!(p->mask & (1 << k)))
if (!(p->mask & (1LL << k)))
continue;
switch (sample_format(smps[i], k)) {

View file

@ -104,7 +104,7 @@ int memory_lock(size_t lock)
debug(LOG_MEM | 2, "Increased ressource limit of locked memory to %zd bytes", lock);
}
#endif /* __arm__ */
out:
#ifdef _POSIX_MEMLOCK
/* Lock all current and future memory allocations */
ret = mlockall(MCL_CURRENT | MCL_FUTURE);

View file

@ -598,26 +598,18 @@ int uldaq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re
{
struct uldaq *u = (struct uldaq *) n->_vd;
size_t buffer_incr = n->in.vectorize * u->in.channel_count;
pthread_mutex_lock(&u->in.mutex);
/* Wait for data available condition triggered by event callback */
if (u->in.buffer_pos + buffer_incr < u->in.transfer_status.currentIndex)
pthread_cond_wait(&u->in.cv, &u->in.mutex);
#if 1
debug(2, "Total count = %lld", u->in.transfer_status.currentTotalCount);
debug(2, "Index = %lld", u->in.transfer_status.currentIndex);
debug(2, "Scan count = %lld", u->in.transfer_status.currentScanCount);
debug(2, "Buffer pos = %zu", u->in.buffer_pos);
#endif
if (u->in.status != SS_RUNNING)
return -1;
long long 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)
pthread_cond_wait(&u->in.cv, &u->in.mutex);
for (int j = 0; j < cnt; j++) {
struct sample *smp = smps[j];