From eff9164c6e46b0817d47855498fd97c7dc68c327 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Sun, 14 Apr 2024 15:37:23 +0100 Subject: [PATCH] Add the named alt-function to the "debug" display --- rpipins/__main__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rpipins/__main__.py b/rpipins/__main__.py index 000e39d..ddf61ea 100755 --- a/rpipins/__main__.py +++ b/rpipins/__main__.py @@ -64,7 +64,7 @@ DIAGRAM = [row[LEFT_COLS_END] for row in PINOUT] COLS = ["pins", "gpio", "i2c", "spi"] -DEBUG_COLS = ["consumer", "mode", "drive", "pull", "state"] +DEBUG_COLS = ["consumer", "alt_func", "mode", "drive", "pull", "state"] NUM_DEBUG_COLS = len(DEBUG_COLS) NUM_GPIOS = 28 @@ -121,8 +121,11 @@ def get_current_pin_states(chip): drive = "--" if pull == "pn": pull = "--" + alt_func = "" + if re.match(r"a\d", mode): + alt_func = mode_name consumer = gpio_user[n] or "" - states.append([consumer, mode, drive, pull, state]) + states.append([consumer, alt_func, mode, drive, pull, state]) except FileNotFoundError: return [["--"] * NUM_DEBUG_COLS] * NUM_GPIOS @@ -167,6 +170,7 @@ def gpio_update_line_states(chip): "panel_light": "#000000 on #fdf6e3", "diagram": "#555555", "consumer": "#989898", + "alt_func": "#989898", "mode": "#989898", "drive": "#989898", "pull": "#989898",