crank up sampling frequency to the max

This commit is contained in:
Denis 2023-12-28 18:01:34 +01:00
parent f7ee474659
commit 089e289003
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
2 changed files with 20 additions and 6 deletions

View file

@ -1,4 +1,18 @@
#!/bin/bash #!/bin/bash
cd /sys/bus/iio/devices/iio\:device0
echo "void" > trigger/current_trigger for i in /sys/bus/iio/devices/* ; do
echo 0 > buffer0/enable if [ -d "$i" ]; then
if [ -f "$i/name" ]; then
name=$(cat "$i/name")
if [ "$name" = "bmi323-imu" ]; then
# bind fake hrtimer to to the iio device
echo "void" > "$i/trigger/current_trigger"
# enable the buffer
echo 0 > "$i/buffer0/enable"
echo "bmi323-imu buffer started"
fi
fi
fi
done

View file

@ -17,7 +17,7 @@ for i in /sys/bus/iio/devices/* ; do
if [ -f "$i/name" ]; then if [ -f "$i/name" ]; then
name=$(cat "$i/name") name=$(cat "$i/name")
if [ "$name" = "rogue" ]; then if [ "$name" = "rogue" ]; then
echo "800" > "$i/sampling_frequency" echo "1600" > "$i/sampling_frequency"
fi fi
fi fi
fi fi
@ -31,8 +31,8 @@ for i in /sys/bus/iio/devices/* ; do
if [ "$name" = "bmi323-imu" ]; then if [ "$name" = "bmi323-imu" ]; then
# change chip sampling frequency # change chip sampling frequency
echo "800.000000" > "$i/in_accel_sampling_frequency" echo "1600.000000" > "$i/in_accel_sampling_frequency"
echo "800.000000" > "$i/in_anglvel_sampling_frequency" echo "1600.000000" > "$i/in_anglvel_sampling_frequency"
# enable accel data acquisition # enable accel data acquisition
echo 1 > "$i/scan_elements/in_accel_x_en" echo 1 > "$i/scan_elements/in_accel_x_en"