rename start_audio_amp to audio_amp

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-05-08 23:21:10 +02:00
parent 52cf2a0f5d
commit 0d19c7a7f1
13 changed files with 64 additions and 57 deletions

View File

@ -0,0 +1,52 @@
#!/bin/sh
# Uncomment the following line to get debug info
#set -x
SELF="$(basename ${0})"
SYSTEM_GPIO="/sys/class/gpio"
# Power Audio Amplifier enable GPIO (('F' - 'A') * 32 + 6 = 166)
GPIO_PF6=166
usage() {
>2& echo "Usage: ${SELF} [1|on|ON|On for ON, 0|off|OFF|Off for OFF]"
exit 1
}
# Check number of arguments
if [ ${#} -ne 1 ]; then
usage
fi
case "${1}" in
1|on|ON|On)
# Turn ON only if volume is not null
if [ "$(volume get)" -ne "0" ]; then
echo "Turning audio amplifier ON"
else
exit 0
fi
enable=1
;;
0|off|OFF|Off)
echo "Turning audio amplifier OFF"
enable=0
;;
*)
usage
;;
esac
# Export the GPIO if necessary
if [ ! -d "${SYSTEM_GPIO}/gpio${GPIO_PF6}" ]; then
echo ${GPIO_PF6} > "${SYSTEM_GPIO}/export"
fi
# Enable/disable the pwoer audio amplifier
echo "out" > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/direction"
echo ${enable} > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/value"
exit 0

View File

@ -11,7 +11,7 @@ REBOOTING_FILE="/run/rebooting"
touch $REBOOTING_FILE
# Shutdown amp
start_audio_amp 0 >/dev/null 2>&1
audio_amp off >/dev/null 2>&1
# Force Read Only
ro

View File

@ -1,45 +0,0 @@
#!/bin/sh
SELF="$(basename ${0})"
SYSTEM_GPIO="/sys/class/gpio"
# Power Audio Amplifier enable GPIO
GPIO_PF6=166
usage() {
>2& echo "Usage: ${SELF} [1 for on, 0 for off]"
exit 1
}
# Check number of args
if [ ${#} -ne 1 ]; then
usage
fi
# Check enable arg
enable=${1}
if [ "${enable}" -eq 1 -o "${enable}" = "on" ]; then
# Turn ON only if volume is not null
if [ "$(volume get)" -ne "0" ]; then
echo "Turning audio amplifier ON"
else
exit 0
fi
enable=1
elif [ "${enable}" -eq 0 -o "${enable}" = "off" ]; then
echo "Turning audio amplifier OFF"
enable=0
else
usage
fi
# Export the GPIO if necessary
if [ ! -d "${SYSTEM_GPIO}/gpio${GPIO_PF6}" ]; then
echo ${GPIO_PF6} > "${SYSTEM_GPIO}/export"
fi
# Enable/disable the pwoer audio amplifier
echo "out" > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/direction"
echo ${enable} > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/value"
exit 0

View File

@ -82,9 +82,9 @@ set_volume() {
# Turn on/off audio amplifier if necessary
if [ ${current_volume} -eq 0 -a ${new_volume} -ne 0 ]; then
start_audio_amp 1
audio_amp on
elif [ ${current_volume} -ne 0 -a ${new_volume} -eq 0 ]; then
start_audio_amp 0
audio_amp off
fi
}

View File

@ -4,7 +4,7 @@
#
################################################################################
FCEUX_VERSION = 093cfff
FCEUX_VERSION = 959126d
FCEUX_SITE_METHOD = git
FCEUX_SITE = https://github.com/FunKey-Project/fceux.git
FCEUX_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
PCSX_REARMED_VERSION = 1b219e7
PCSX_REARMED_VERSION = ce405c0
PCSX_REARMED_SITE_METHOD = git
PCSX_REARMED_SITE = https://github.com/FunKey-Project/pcsx_rearmed.git
PCSX_REARMED_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
POCKETSNES_VERSION = cd83988
POCKETSNES_VERSION = 033eb1c
POCKETSNES_SITE_METHOD = git
POCKETSNES_SITE = https://github.com/FunKey-Project/PocketSNES.git
POCKETSNES_LICENSE = GPL-2.0

View File

@ -3,7 +3,7 @@
# gmenu2x
#
#############################################################
GMENU2X_VERSION = de79b3b
GMENU2X_VERSION = 3e23dd2
GMENU2X_SITE_METHOD = git
GMENU2X_SITE = https://github.com/FunKey-Project/gmenu2x.git
GMENU2X_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
GNUBOY_VERSION = 666b6b1
GNUBOY_VERSION = f23d3e3
GNUBOY_SITE_METHOD = git
GNUBOY_SITE = https://github.com/FunKey-Project/gnuboy.git
GNUBOY_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
GPSP_VERSION = 340d3b8
GPSP_VERSION = 3e776a9
GPSP_SITE_METHOD = git
GPSP_SITE = https://github.com/FunKey-Project/gpsp.git
GPSP_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
MEDNAFEN_VERSION = bf63885
MEDNAFEN_VERSION = f81201c
MEDNAFEN_SITE_METHOD = git
MEDNAFEN_SITE = https://github.com/FunKey-Project/mednafen-git.git
MEDNAFEN_LICENSE = GPL-2.0+

View File

@ -4,7 +4,7 @@
#
################################################################################
PICODRIVE_VERSION = 48024ef
PICODRIVE_VERSION = 0582aba
PICODRIVE_SITE_METHOD = git
PICODRIVE_SITE = https://github.com/FunKey-Project/picodrive.git
PICODRIVE_LICENSE = MAME

View File

@ -4,7 +4,7 @@
#
################################################################################
RETROFE_VERSION = 625207d
RETROFE_VERSION = 7fc674e
RETROFE_SITE_METHOD = git
RETROFE_SITE = https://github.com/FunKey-Project/RetroFE.git
RETROFE_DEPENDENCIES = gstreamer1 gst1-plugins-base sdl sdl_image sdl_mixer sdl_sound sdl_ttf libglib2 sqlite zlib