summaryrefslogtreecommitdiffstats
path: root/tests/heb/debug/debug.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2014-03-19 23:12:31 +0100
committerSuren A. Chilingaryan <csa@suren.me>2014-03-19 23:12:31 +0100
commitef4f563559f195672d07114670a461a7c55ea22b (patch)
tree300e583a062fd7fe017d59fc68edef5d84184a85 /tests/heb/debug/debug.sh
parent3b410e54d3925a903adb2cc479177afc579c7679 (diff)
downloadipecamera-ef4f563559f195672d07114670a461a7c55ea22b.tar.gz
ipecamera-ef4f563559f195672d07114670a461a7c55ea22b.tar.bz2
ipecamera-ef4f563559f195672d07114670a461a7c55ea22b.tar.xz
ipecamera-ef4f563559f195672d07114670a461a7c55ea22b.zip
Add HEB scripts and re-organize the structure
Diffstat (limited to 'tests/heb/debug/debug.sh')
-rwxr-xr-xtests/heb/debug/debug.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/heb/debug/debug.sh b/tests/heb/debug/debug.sh
new file mode 100755
index 0000000..2db21d4
--- /dev/null
+++ b/tests/heb/debug/debug.sh
@@ -0,0 +1,45 @@
+#! /bin/bash
+
+SCRIPT_PATH="`dirname \"$0\"`"
+SCRIPT_PATH="`( cd \"$TESTS_PATH\" && pwd )`"
+PCILIB_PATH=${SCRIPT_PATH%/tests/*}
+
+function pci {
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
+}
+
+function strip_bad_values {
+ LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/apps/heb_strip_bad_values $*
+}
+
+function request_data {
+ $PCILIB_PATH/tests/heb/debug/request_data.sh $*
+}
+
+while [ 1 ]; do
+ from=`pci --list-dma-engines | grep C2S | sed -s 's/\s\+/ /g' | cut -d ' ' -f 6`
+ to=`pci --list-dma-engines | grep C2S | sed -s 's/\s\+/ /g' | cut -d ' ' -f 8`
+
+ if [ $from -gt $to ]; then
+ buffers="`seq $from 255` `seq 0 $to`"
+ else
+ buffers=`seq $from $to`
+ fi
+
+ echo $buffers
+
+ rm data.out
+ for i in $buffers; do
+ pci --read-dma-buffer dma1r:$i -o data.out
+ done
+
+
+ error=`strip_bad_values data.out | head -n 1 | cut -f 1 -d ':'`
+ if [ $error != "0x1140" ]; then
+ echo "Problems found"
+ exit
+ else
+ echo "Fine"
+ request_data
+ fi
+done