From 773c4e9d9972f080a09be9b0473401d9b9ba24f1 Mon Sep 17 00:00:00 2001 From: MaxineMuster <146550015+MaxineMuster@users.noreply.github.com> Date: Sat, 19 Jul 2025 09:58:49 +0200 Subject: [PATCH] Only report used channels up to PIN_IOR_NofChan() for this role (#1725) --- src/new_pins.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/new_pins.c b/src/new_pins.c index 71c4c20eb..eeceba576 100644 --- a/src/new_pins.c +++ b/src/new_pins.c @@ -1727,10 +1727,11 @@ bool CHANNEL_IsInUse(int ch) { for (i = 0; i < PLATFORM_GPIO_MAX; i++) { if (g_cfg.pins.roles[i] != IOR_None) { - if (g_cfg.pins.channels[i] == ch) { + int NofC=PIN_IOR_NofChan(g_cfg.pins.roles[i]); + if (NofC>=1 && g_cfg.pins.channels[i] == ch) { return true; } - if (g_cfg.pins.channels2[i] == ch) { + if (NofC>=2 && g_cfg.pins.channels2[i] == ch) { return true; } }