#!/bin/bash

pedal_gpio_pin=32

# Wait for GPIO setup
# If don’t the software will be restarted several times
for i in {1..15}
do
  if [ -d /sys/class/gpio/gpio$pedal_gpio_pin ]; then
    break
  else
    sleep 1
  fi
done

# Launch software
cd /home/eyepoint/Develop/eyepoint-s1
./eyepoint_s -a com:///dev/ttyACM0 -b com:///dev/ttyACM1 \
--window embedded --screenshot-external-media-path=/mnt \
--freeze-gpio $pedal_gpio_pin --freeze-gpio-inverted \
--screenshot-external-media-only --screenshot-no-save-as-dialog \
--hide-cursor
