summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wlan-ng
diff options
context:
space:
mode:
authorIan Abbott2015-10-27 17:59:11 +0100
committerGreg Kroah-Hartman2015-10-29 00:58:36 +0100
commit19e86985b08e2470aeb805f71d2e2ebf19bcdc95 (patch)
tree094399e88a5d62dc78f4a0483dd574c2ff68df9f /drivers/staging/wlan-ng
parentstaging: comedi: comedi_test: reformat multi-line comments (diff)
downloadkernel-qcow2-linux-19e86985b08e2470aeb805f71d2e2ebf19bcdc95.tar.gz
kernel-qcow2-linux-19e86985b08e2470aeb805f71d2e2ebf19bcdc95.tar.xz
kernel-qcow2-linux-19e86985b08e2470aeb805f71d2e2ebf19bcdc95.zip
staging: comedi: comedi_test: saturate fake waveform values
While an asynchronous command is running on the analog input subdevice, fake waveform generators are connected to each channel to provide the input voltages that are converted to sample value. Channel 0 is connected to a sawtooth generator, channel 1 is connected to a squarewave generator, and the remaining channels are connected to a flatline generator. The non-flatline generators share the same amplitude (in microvolts) and period (in microseconds) which are configured when the COMEDI device is attached. All waveforms are centered around 0 microvolts and the non-flatline waveforms go between -amplitude and +amplitude. It is possible for the waveforms to swing outside the input range of the channels to which they are connected. When that happens, the sample values resulting from simulated A-to-D conversion will wrap around due to integer overflow. Prevent that by clamping the sample values that would go out of range. This is closer to how a real hardware device would behave (assuming the input voltage is not high enough to damage the hardware!). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
0 files changed, 0 insertions, 0 deletions