m1n1.proxy: Default to /dev/m1n1

We have udev rules, let's just default to a pretty device name to avoid
conflicts with other devices.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-07-30 14:06:30 +09:00
parent 0cf1f393ed
commit 1247c2b7e4

View file

@ -135,7 +135,7 @@ class UartInterface(Reloadable):
self.debug = debug self.debug = debug
self.devpath = None self.devpath = None
if device is None: if device is None:
device = os.environ.get("M1N1DEVICE", "/dev/ttyACM0:115200") device = os.environ.get("M1N1DEVICE", "/dev/m1n1:115200")
if isinstance(device, str): if isinstance(device, str):
baud = 115200 baud = 115200
if ":" in device: if ":" in device:
@ -1076,7 +1076,7 @@ __all__.extend(k for k, v in globals().items()
if __name__ == "__main__": if __name__ == "__main__":
import serial import serial
uartdev = os.environ.get("M1N1DEVICE", "/dev/ttyACM0") uartdev = os.environ.get("M1N1DEVICE", "/dev/m1n1")
usbuart = serial.Serial(uartdev, 115200) usbuart = serial.Serial(uartdev, 115200)
uartif = UartInterface(usbuart, debug=True) uartif = UartInterface(usbuart, debug=True)
print("Sending NOP...", end=' ') print("Sending NOP...", end=' ')