RK3399 - Fix HP detection in HDMI script

This commit is contained in:
mason 2023-07-09 19:52:58 +00:00 committed by fewtarius
parent 56e165e86c
commit be50dfd271
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -11,16 +11,12 @@ if [ ! -d "/sys/class/gpio/gpio${DEVICE_HDMI_GPIO}" ]; then
echo in > /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/direction
fi
# Pull GPIO for Speaker / Headphone plugged
if [ -d "/sys/class/gpio/gpio${DEVICE_JACK}" ]; then
HP_GPIO=$(cat /sys/class/gpio/gpio${DEVICE_JACK}/value)
fi
# Check HDMI plugged / unplugged, set audio output, restart Emulation Station
HDMI_VALUE=$(cat /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/value)
while true
do
HDMI_NEW_VALUE=$(cat /sys/class/gpio/gpio${DEVICE_HDMI_GPIO}/value)
HP_GPIO=$(cat /sys/class/gpio/gpio${DEVICE_JACK}/value)
if test "${HDMI_VALUE}" != "${HDMI_NEW_VALUE}"
then