Commit 536de938 authored by Federico Vaga's avatar Federico Vaga

Merge branch 'release/v2.5.4' into master

parents aac876d9 d611120f
..
SPDX-License-Identifier: CC-0.0
SPDX-FileCopyrightText: 2019 CERN
=========
Changelog
=========
2.5.4 - 2020-10-07
==================
Added
-----
- tst: text acquisitions with negative patterns
Fixed
-----
- py: fix path to debugfs options "pattern data"
- lib: fix path to debugfs options "trigger software"
- tst: fix PyAdcBuf pointer usage to use get_sample()
......@@ -588,7 +588,7 @@ class PyFmcAdc100m14b4ch(PyAdcAbstract):
def __init__(self, devid):
super(PyFmcAdc100m14b4ch, self).__init__(devid)
self.__dbg_path = "/sys/kernel/debug/adc-100m14b-{:04x}/".format(self.dev_id)
self.__dbg_path = "/sys/kernel/debug/fmc-adc-100m.{:d}.auto/".format(self.dev_id)
@property
def pattern_data(self):
......
......@@ -918,7 +918,7 @@ static int adc_100m14b4cha_trigger_fire(struct adc_dev *dev)
int fd, ret;
snprintf(pathname, sizeof(pathname),
"/sys/kernel/debug/adc-100m14b-%04x/trigger_software",
"/sys/kernel/debug/fmc-adc-100m.%d.auto/trigger_software",
fa->dev_id);
fd = open(pathname, O_WRONLY);
if (fd < 0)
......
......@@ -7,7 +7,8 @@ import pytest
import time
from PyAdcLib import PyAdcConf, PyFmcAdc100m14b4ch, timeval
@pytest.fixture(scope="function", params=[1 << i for i in range(14)])
@pytest.fixture(scope="function", params=[1 << i for i in range(14)] + \
[0x2000 + (1 << i) for i in range(13)])
def adc_simple_pattern(adc_simple, request):
adc_simple.pattern_data = request.param
yield adc_simple
......@@ -70,7 +71,11 @@ class TestAdcAcquisitionPattern(object):
for n in range(nshots):
for chan in range(4):
for s in range(nsamples):
assert buf.get_sample(chan, s) >> 2 == pattern, \
buf.contents.data[:nsamples]
sample = abs(buf.contents.get_sample(chan, s) >> 2)
if pattern >= 0x2000:
# for negative numbers
assert 0x4000 == pattern + sample, buf.contents.data[:nsamples]
else:
assert sample == pattern, buf.contents.data[:nsamples]
adc_simple_pattern.release_buffer(buf, None)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment