Skip to content

Commit

Permalink
Add the named alt-function to the "debug" display
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch committed Apr 14, 2024
1 parent 4ff1e73 commit eff9164
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rpipins/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit eff9164

Please sign in to comment.