mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-29 18:00:18 +00:00
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:
parent
0cf1f393ed
commit
1247c2b7e4
1 changed files with 2 additions and 2 deletions
|
@ -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=' ')
|
||||||
|
|
Loading…
Reference in a new issue