2022-03-28 09:34:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-03-28 10:10:55 +00:00
|
|
|
set -x
|
|
|
|
if test -f "/sys/kernel/debug/iio/iio:device0/direct_reg_access"; then
|
|
|
|
device_path=/sys/kernel/debug/iio/iio:device0/
|
|
|
|
else if test -f "/sys/kernel/debug/iio/iio:device1/direct_reg_access"; then
|
|
|
|
device_path=/sys/kernel/debug/iio/iio:device1/
|
|
|
|
else if test -f "/sys/kernel/debug/iio/iio:device2/direct_reg_access"; then
|
|
|
|
device_path=/sys/kernel/debug/iio/iio:device2/
|
|
|
|
else if test -f "/sys/kernel/debug/iio/iio:device3/direct_reg_access"; then
|
|
|
|
device_path=/sys/kernel/debug/iio/iio:device3/
|
|
|
|
else if test -f "/sys/kernel/debug/iio/iio:device4/direct_reg_access"; then
|
|
|
|
device_path=/sys/kernel/debug/iio/iio:device4/
|
|
|
|
else
|
|
|
|
echo "Check log to make sure ad9361 driver is loaded!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
set +x
|
|
|
|
|
2022-03-28 09:34:48 +00:00
|
|
|
(bash -c 'echo $PPID' > /tmp/check_calib_inf.pid
|
|
|
|
while true; do
|
2022-03-28 10:10:55 +00:00
|
|
|
echo 0x0A7 > ${device_path}direct_reg_access
|
|
|
|
status=$( cat ${device_path}direct_reg_access )
|
2022-03-28 09:34:48 +00:00
|
|
|
if [ $status == "0xFF" ]; then
|
|
|
|
echo "WARNING: Tx Quadrature Calibration failed."
|
|
|
|
fi
|
|
|
|
sleep 5
|
|
|
|
done) &
|
|
|
|
|