Skip to content

Commit

Permalink
UDC check
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau committed Dec 12, 2024
1 parent 6e9a4a0 commit b623a00
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions userspace/usr/comma/comma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ handle_adb () {
sudo cp /usr/comma/99-android.rules /etc/udev/rules.d/99-android.rules
sudo chmod 777 /etc/udev/rules.d/99-android.rules
sudo chmod a+r /etc/udev/rules.d/99-android.rules

# Check if UDC exists
if [ -e "/sys/class/udc/a600000.dwc3" ]; then
# First unbind any existing gadgets
sudo sh -c 'echo "" > UDC'
sleep 0.5
# Try to bind the new gadget
sudo sh -c 'echo "a600000.dwc3" > UDC' || echo "Failed to bind USB gadget to controller"
else
echo "USB controller a600000.dwc3 not found"
fi

# Create plugdev group if it doesn't exist
sudo groupadd -f plugdev
Expand Down

0 comments on commit b623a00

Please sign in to comment.