Makefile: Make sudo optional for tty access

Being in the proper group is sometimes enough to avoid needing sudo to
access tty devices. If not done by the distro, a udev rule isn't too
hard to tweak to get convenient permissions on the device (using lsusb
to fill in XXXX and YYYY):
SUBSYSTEMS=="usb", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", GROUP="uucp"
This commit is contained in:
Eric Anderson 2021-11-20 14:45:24 -08:00
parent fe15fc3b9a
commit caeff9a3cb

View file

@ -99,15 +99,16 @@ endif
BAUD=115200
DEV=/dev/ttyUSB0
SUDO=sudo
ocd: gotek
python3 scripts/openocd/flash.py `pwd`/FF_Gotek-$(VER).hex
flash: gotek
sudo stm32flash -b $(BAUD) -w FF_Gotek-$(VER).hex $(DEV)
$(SUDO) stm32flash -b $(BAUD) -w FF_Gotek-$(VER).hex $(DEV)
start:
sudo stm32flash -b $(BAUD) -g 0 $(DEV)
$(SUDO) stm32flash -b $(BAUD) -g 0 $(DEV)
serial:
sudo miniterm.py $(DEV) 3000000
$(SUDO) miniterm.py $(DEV) 3000000