Files
2026_project_software_diode/raspberry-pi/root/scripts/serial-wait.sh
2026-06-25 08:12:43 +03:00

19 lines
317 B
Bash
Executable File

#!/bin/bash
SERIAL_PORT="/dev/ttyGS0"
stty -F "$SERIAL_PORT" raw
while true
do
if read -r line < "$SERIAL_PORT"
then
# wait for done message
if [ "$line" = "DONE" ]
then
echo "" > /sys/kernel/config/usb_gadget/g1/UDC
exit
fi
fi
sleep 0.5
done