Add LED brightness control (min/mid/max).
This commit is contained in:
parent
7d4e8a8087
commit
0277e21c58
3 changed files with 33 additions and 11 deletions
|
@ -21,7 +21,7 @@ makeinstall_target() {
|
|||
cp ${PKG_DIR}/sources/scripts/system_utils ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/volume_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/bluetooth_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/led_mgr ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/ledcontrol ${INSTALL}/usr/bin
|
||||
if [ -d "${PKG_DIR}/sources/devices/${DEVICE}" ]
|
||||
then
|
||||
cp ${PKG_DIR}/sources/devices/${DEVICE}/* ${INSTALL}/usr/bin
|
||||
|
|
|
@ -62,6 +62,7 @@ function off() {
|
|||
do
|
||||
### RGB off command
|
||||
${ECTOOL} -w 0xb1 -z 0x02 >/dev/null 2>&1
|
||||
${ECTOOL} -w 0xb2 -z 0xc0 >/dev/null 2>&1
|
||||
mode 0x10
|
||||
done
|
||||
}
|
||||
|
@ -88,16 +89,29 @@ function color() {
|
|||
done
|
||||
}
|
||||
|
||||
if [ "${2}" ]
|
||||
then
|
||||
LEDBRIGHTNESS=${2}
|
||||
else
|
||||
LEDBRIGHTNESS=$(get_setting led.brightness)
|
||||
if [ -z "${LEDBRIGHTNESS}" ]
|
||||
then
|
||||
|
||||
LEDBRIGHTNESS=${2}
|
||||
case ${LEDBRIGHTNESS} in
|
||||
max)
|
||||
LEDBRIGHTNESS=ff
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
mid)
|
||||
LEDBRIGHTNESS=80
|
||||
;;
|
||||
low)
|
||||
LEDBRIGHTNESS=40
|
||||
;;
|
||||
*)
|
||||
LEDBRIGHTNESS=$(get_setting led.brightness)
|
||||
if [ -z "${LEDBRIGHTNESS}" ]
|
||||
then
|
||||
LEDBRIGHTNESS=ff
|
||||
else
|
||||
LEDBRIGHTNESS=${2}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
debug_out "led brightness: ${LEDBRIGHTNESS}"
|
||||
|
||||
case $1 in
|
||||
|
@ -136,6 +150,14 @@ case $1 in
|
|||
del_setting led.color
|
||||
del_setting led.brightness
|
||||
;;
|
||||
brightness)
|
||||
COLOR=$(get_setting led.color)
|
||||
if [ ! -z "${COLOR}" ]
|
||||
then
|
||||
off
|
||||
led_mgr ${COLOR} ${LEDBRIGHTNESS}
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
COLOR=$(get_setting led.color)
|
||||
LEDBRIGHTNESS=$(get_setting led.brightness)
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 2020-present Fewtarius
|
||||
|
||||
PKG_NAME="emulationstation"
|
||||
PKG_VERSION="af17d8c"
|
||||
PKG_VERSION="579b7c7"
|
||||
PKG_GIT_CLONE_BRANCH="main"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
|
|
Loading…
Reference in a new issue