/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to tests/ipecamera/debug/incomplete.sh

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-20 20:01:04 UTC
  • Revision ID: csa@suren.me-20150420200104-b5xny65io8lvoz3w
Big redign of model structures

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/bash
2
 
 
3
 
function pci {
4
 
    PCILIB_PATH="/root/pcitool"
5
 
    LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
6
 
}
7
 
 
8
 
rm -f images.raw
9
 
touch images.raw
10
 
 
11
 
echo "Starting the grabber"
12
 
pci --stop-dma
13
 
pci --start-dma dma1
14
 
pci -g -o images.raw --run-time 1000000000 &
15
 
pid=$!
16
 
 
17
 
usleep 1000000
18
 
 
19
 
for i in `seq 1 100000`; do
20
 
    old_size=`ls -la images.raw | cut -d " " -f 5`
21
 
    echo "Trigger $i"
22
 
    pci --trigger
23
 
    usleep 100000
24
 
    new_size=`ls -la images.raw | cut -d " " -f 5`
25
 
    if [ $old_size -eq $new_size ]; then
26
 
        sleep 2
27
 
        new_size=`ls -la images.raw | cut -d " " -f 5`
28
 
        if [ $old_size -eq $new_size ]; then
29
 
            echo "Incomplete frame..."
30
 
            killall -SIGINT pci
31
 
            break
32
 
        fi
33
 
    fi
34
 
done
35
 
 
36
 
echo "Waiting grabber to finish"
37
 
wait $pid