Skip to content

Commit

Permalink
Merge pull request #22 from sourcebots/pinctrl
Browse files Browse the repository at this point in the history
The sysfs interface is deprecated, switch to using pinctrl
  • Loading branch information
WillB97 authored Jul 12, 2024
2 parents 2092ccc + bc58016 commit 919358e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion parts/files/leds/boot_40.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=Boot Progress 40%
[Service]
Type=simple
ExecStart=/usr/bin/set-led 5 1
ExecStart=/usr/bin/pinctrl set 5 op dh

[Install]
WantedBy=basic.target
2 changes: 1 addition & 1 deletion parts/files/leds/boot_60.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/set-led 12 1
ExecStart=/usr/bin/pinctrl set 12 op dh

[Install]
WantedBy=multi-user.target
4 changes: 2 additions & 2 deletions parts/files/leds/boot_80.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ After=runusb.service

[Service]
Type=forking
ExecStart=/usr/bin/set-led 6 1
ExecStop=/usr/bin/set-led 6 0
ExecStart=/usr/bin/pinctrl set 6 op dh
ExecStop=/usr/bin/pinctrl set 6 op dl
RemainAfterExit=yes

[Install]
Expand Down
9 changes: 0 additions & 9 deletions parts/files/leds/set-led

This file was deleted.

2 changes: 0 additions & 2 deletions parts/robot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ SUBSYSTEM=="usb", ATTRS{idVendor}=="1bda", ATTRS{idProduct}=="0011", GROUP="$gro
EOF

# Setup KCH leds triggered by systemd
cp /tmp/packer-files/leds/set-led /usr/bin/
chmod +x /usr/bin/set-led
cp /tmp/packer-files/leds/*.service /lib/systemd/system/
systemctl enable boot_40.service
systemctl enable boot_60.service
Expand Down

0 comments on commit 919358e

Please sign in to comment.