0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-01-09 17:15:22 +00:00
David Lawson 841033e685 RPi4-PiBoyDmg: switch back to compiling xpi_gamecon as a module (#1832)
* RPi4-PiBoyDmg: switch back to compiling xpi_gamecon as a module

This fixes PiBoy DMG not booting with Lakka v5

* RPi4-PiBoyDmg: audio device is now PCM
2024-04-10 17:04:34 +02:00

46 lines
922 B
Bash
Executable File

#!/bin/bash
stop_retroarch() {
systemctl stop \
retroarch.service \
tmp-assets.mount \
tmp-cheats.mount \
tmp-cores.mount \
tmp-database.mount \
tmp-joypads.mount \
tmp-overlays.mount \
tmp-shaders.mount \
tmp-system.mount
}
while [ 2 -gt 1 ]
do
sleep 1
VOL=`cat /sys/kernel/xpi_gamecon/volume`
TEMP=`cat /sys/class/thermal/thermal_zone0/temp`
POWERSW=`cat /sys/kernel/xpi_gamecon/status`
BATTERY=`cat /sys/kernel/xpi_gamecon/percent`
amixer -M set PCM $VOL%
if [[ $TEMP -gt 70000 ]]
then
echo 100 > /sys/kernel/xpi_gamecon/fan
else
echo 0 > /sys/kernel/xpi_gamecon/fan
fi
if [[ $POWERSW -eq 6 ]]
then
stop_retroarch
echo "0" > /sys/kernel/xpi_gamecon/flags
/usr/sbin/rmmod xpi_gamecon
/usr/sbin/shutdown -P
fi
if [[ $BATTERY -lt 5 ]]
then
stop_retroarch
echo "0" > /sys/kernel/xpi_gamecon/flags
/usr/sbin/rmmod xpi_gamecon
/usr/sbin/shutdown -P
fi
done