summaryrefslogtreecommitdiffstats
path: root/utils/ypr0tools/rockbox.sh
diff options
context:
space:
mode:
authorLorenzo Miori <memoryS60@gmail.com>2013-09-10 22:48:34 +0200
committerThomas Martitz <kugel@rockbox.org>2014-02-05 09:56:21 +0100
commite876f4df6d240bd2e319b1e63be95a625f049a97 (patch)
treece2fe1b24650e3be7a6cd2d346d29090a5422a8c /utils/ypr0tools/rockbox.sh
parentb828b9d99bff2acc0e1f543f3176fd4b632cba68 (diff)
downloadrockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.tar.gz
rockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.tar.bz2
rockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.zip
Samsung YP-R1 target port
This is the basic port to the new target Samsung YP-R1, which runs on a similar platform as YP-R0. Port is usable, although there are still some optimizations that have to be done. Change-Id: If83a8e386369e413581753780c159026d9e41f04
Diffstat (limited to 'utils/ypr0tools/rockbox.sh')
-rwxr-xr-xutils/ypr0tools/rockbox.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/ypr0tools/rockbox.sh b/utils/ypr0tools/rockbox.sh
index 85e1b43533..fcae06d717 100755
--- a/utils/ypr0tools/rockbox.sh
+++ b/utils/ypr0tools/rockbox.sh
@@ -14,11 +14,18 @@
# expected to run $MAINFILE
# Check for menu button being pressed. Return immediately to launch the OF
-var=$(dd if=/dev/r0Btn bs=4 count=1)
-# Here a workaround to detect the byte
-var2=$(echo -e -n "\x07")
+if [ -e "/dev/r1Button" ]
+then
+ # running on YP-R1 model (volume up button)
+ BTN=$(echo -e -n "\x02")
+ VAL=$(dd if=/dev/r1Button bs=4 count=1)
+else
+ # running on YP-R0 model (menu button)
+ BTN=$(echo -e -n "\x07")
+ VAL=$(dd if=/dev/r0Btn bs=4 count=1)
+fi
-if [[ "$var" = "$var2" ]]
+if [[ "$VAL" = "$BTN" ]]
then
return
fi