From 9f18fee124587c99a091e5d40880478259b6e536 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 24 Jan 2021 22:17:56 -0500 Subject: [PATCH] Fix ERC for nets with power input and input pins Fixes https://gitlab.com/kicad/code/kicad/-/issues/7264 --- eeschema/erc.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index d934f16e7a..f4a1be5f4a 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -475,11 +475,15 @@ int ERC_TESTER::TestPinToPin() if( DrivenPinTypes.count( refType ) ) { // needsDriver will be the pin shown in the error report eventually, so try to - // upgrade to a "better" pin if possible: something visible and not a power symbol + // upgrade to a "better" pin if possible: something visible and only a power symbol + // if this net needs a power driver if( !needsDriver || - ( !needsDriver->IsVisible() && refPin->IsVisible() ) || - ( needsDriver->IsPowerConnection() && !refPin->IsPowerConnection() ) ) + ( !needsDriver->IsVisible() && refPin->IsVisible() ) || + ( ispowerNet != needsDriver->IsPowerConnection() && + ispowerNet == refPin->IsPowerConnection() ) ) + { needsDriver = refPin; + } } if( ispowerNet )