From 3ec84d28dad998c84cd7308efe3d9180975800af Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 5 Jul 2021 12:25:24 -0400 Subject: [PATCH] serial port config include device (eg /dev/ttyS3) in label (eg TELEM/SERIAL 4 (/dev/ttyS3)) --- Tools/serial/generate_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/serial/generate_config.py b/Tools/serial/generate_config.py index 099091dfe4..4825b5e695 100755 --- a/Tools/serial/generate_config.py +++ b/Tools/serial/generate_config.py @@ -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"] })