mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
SM8550: Set gamepad as fake xbox for AYANEO devices
This commit is contained in:
@@ -7,12 +7,9 @@
|
||||
SERIAL_DEVICE="/dev/ttyHS0"
|
||||
|
||||
# Open serial device
|
||||
exec 20<>$SERIAL_DEVICE
|
||||
stty -F $SERIAL_DEVICE 115200 -opost -isig -icanon -echo
|
||||
stty -F $SERIAL_DEVICE 115200 -clocal -opost -isig -icanon -echo
|
||||
|
||||
# Send frame to switch gampead to fake xbox 360 controller
|
||||
printf "\xe7\x55\x05\x01\x00\x00\x00\x00\x00\x5b\xed" > /dev/ttyHS0
|
||||
printf "\x35\x35\x30\x35\x30\x31\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" > /dev/ttyHS0
|
||||
|
||||
# Close serial device
|
||||
exec 20>&-
|
||||
printf "\xe7\x55\x05\x01\x00\x00\x00\x00\x00\x5b\xed" >$SERIAL_DEVICE
|
||||
sleep 0.1
|
||||
printf "\x35\x35\x30\x35\x30\x31\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" >$SERIAL_DEVICE
|
||||
@@ -0,0 +1 @@
|
||||
../AYANEO Pocket ACE/020-set-xbox-gamepad
|
||||
@@ -0,0 +1 @@
|
||||
../AYANEO Pocket ACE/020-set-xbox-gamepad
|
||||
@@ -8,8 +8,8 @@ SERIAL_DEVICE="/dev/ttyHS0"
|
||||
|
||||
# Display usage if wrong parameters
|
||||
if [ $# -lt 4 ]; then
|
||||
echo "Usage: $0 <mask_hex> <R> <G> <B>"
|
||||
echo "Example: $0 0F 255 0 0"
|
||||
echo "Usage: $0 <BRIGHTNESS> <R> <G> <B>"
|
||||
echo "Example: $0 255 255 0 0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user