File tree Expand file tree Collapse file tree 4 files changed +79
-0
lines changed
debos-recipes/overlays/arduino-unoq-releases Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Provides bindings for volumeup and volumedown keys on boot
3+ After =multi-user.target
4+
5+ [Service]
6+ Type =oneshot
7+ ExecStart =/opt/arduino/scripts/keybinding_check.sh
8+
9+ [Install]
10+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ function check_key()
4+ {
5+ device=$1
6+ event=$2
7+ keycode=$3
8+
9+ evtest --query ${device} ${event} ${keycode}
10+
11+ ret_val=$?
12+ echo $ret_val
13+ }
14+
15+ exec_path_vold=" /opt/arduino/scripts/volumedown.sh"
16+ exec_path_volu=" /opt/arduino/scripts/volumeup.sh"
17+
18+ volumedown=$( check_key /dev/input/event0 EV_KEY KEY_VOLUMEDOWN)
19+ volumeup=$( check_key /dev/input/event0 EV_KEY KEY_VOLUMEUP)
20+
21+ echo " Volume Down status: ${volumedown} "
22+ echo " Volume Up status: ${volumeup} "
23+
24+ if [ $volumeup -ne 0 ] && [ $volumedown -ne 0 ]; then
25+ echo " Both Volume Up and Volume Down keys are pressed. Ignoring both."
26+ exit 0
27+ fi
28+
29+ if [ ${volumedown} -ne 0 ]; then
30+ bash ${exec_path_vold}
31+ elif [ ${volumeup} -ne 0 ]; then
32+ bash ${exec_path_volu}
33+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This script is triggered when the pin configured as Volume Down in JCTL connector is shorted to GND.
4+ # This script is launched once at startup.
5+ # Feel free to hack it to implement your own functionality.
6+ # Otherwise, it will switch the USB mode to Host.
7+ #
8+ # MPU POWER o o 1V8
9+ #
10+ # MPU RESET o ■ GND
11+ #
12+ # TX o o VOLUME UP
13+ #
14+ # RX o o VOLUME DOWN
15+ # |
16+ # USB BOOT o ■ GND
17+
18+ echo " host" > /sys/kernel/debug/usb/4e00000.usb/mode
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This script is triggered when the pin configured as Volume Up in JCTL connector is shorted to GND.
4+ # This script is launched once at startup.
5+ # Feel free to hack it to implement your own functionality.
6+ # Otherwise, it will switch the USB mode to Device.
7+ #
8+ # MPU POWER o o 1V8
9+ #
10+ # MPU RESET o ■ GND
11+ # |
12+ # TX o o VOLUME UP
13+ #
14+ # RX o o VOLUME DOWN
15+ #
16+ # USB BOOT o ■ GND
17+
18+ echo " device" > /sys/kernel/debug/usb/4e00000.usb/mode
You can’t perform that action at this time.
0 commit comments