diff options
Diffstat (limited to 'utils/ypr0tools/rockbox.sh')
-rwxr-xr-x | utils/ypr0tools/rockbox.sh | 15 |
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 @@ | |||
14 | # expected to run $MAINFILE | 14 | # expected to run $MAINFILE |
15 | 15 | ||
16 | # Check for menu button being pressed. Return immediately to launch the OF | 16 | # Check for menu button being pressed. Return immediately to launch the OF |
17 | var=$(dd if=/dev/r0Btn bs=4 count=1) | 17 | if [ -e "/dev/r1Button" ] |
18 | # Here a workaround to detect the byte | 18 | then |
19 | var2=$(echo -e -n "\x07") | 19 | # running on YP-R1 model (volume up button) |
20 | BTN=$(echo -e -n "\x02") | ||
21 | VAL=$(dd if=/dev/r1Button bs=4 count=1) | ||
22 | else | ||
23 | # running on YP-R0 model (menu button) | ||
24 | BTN=$(echo -e -n "\x07") | ||
25 | VAL=$(dd if=/dev/r0Btn bs=4 count=1) | ||
26 | fi | ||
20 | 27 | ||
21 | if [[ "$var" = "$var2" ]] | 28 | if [[ "$VAL" = "$BTN" ]] |
22 | then | 29 | then |
23 | return | 30 | return |
24 | fi | 31 | fi |