serial port config include device (eg /dev/ttyS3) in label (eg TELEM/SERIAL 4 (/dev/ttyS3))

This commit is contained in:
Daniel Agar
2023-12-19 03:46:38 +09:00
committed by Junwoo Hwang
parent ebae9ae3d7
commit 3ec84d28da
+4 -1
View File
@@ -235,10 +235,13 @@ for tag, device in board_ports:
raise Exception("Unknown serial port {:}. "
"You might have to add it to serial_ports in\n {:}".format(tag,
os.path.realpath(__file__)))
# Helper label to indicate which device is connected to which port (e.g. TELEM1 = /dev/ttyS1)
label_append = (" (" + device + ")") if device != "" else ""
serial_devices.append({
'tag': tag,
'device': device,
'label': serial_ports[tag]["label"],
'label': serial_ports[tag]["label"] + label_append,
'index': serial_ports[tag]["index"],
'default_baudrate': serial_ports[tag]["default_baudrate"]
})