Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
f21d7bc6
Commit
f21d7bc6
authored
Jul 21, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: fixed crash in netlist generation when a component with no pin is found.
parent
38aeb5d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
netform.cpp
eeschema/netform.cpp
+14
-12
No files found.
eeschema/netform.cpp
View file @
f21d7bc6
...
@@ -703,34 +703,36 @@ static void AddPinToComponentPinList( SCH_COMPONENT* Component,
...
@@ -703,34 +703,36 @@ static void AddPinToComponentPinList( SCH_COMPONENT* Component,
static
void
EraseDuplicatePins
(
NETLIST_OBJECT_LIST
&
aPinList
)
static
void
EraseDuplicatePins
(
NETLIST_OBJECT_LIST
&
aPinList
)
/**********************************************************************/
/**********************************************************************/
/*
/*
* Function EraseDuplicatePins
* Function to remove duplicate Pins in the TabPin pin list
* Function to remove duplicate Pins in the TabPin pin list
* (This is a list of pins found in the whole schematic, for a given component)
* (This is a list of pins found in the whole schematic, for a given component)
* These duplicate pins were put in list because some pins (powers... )
* These duplicate pins were put in list because some pins (powers... )
* are found more than one time when we have a multiple parts per package component
* are found more than one time when we have a multiple parts per package component
* for instance, a 74ls00 has 4 parts, and therefore the VCC pin and GND pin appears 4 times
* for instance, a 74ls00 has 4 parts, and therefore the VCC pin and GND pin appears 4 times
* in the list.
* in the list.
* @param aPinList = a NETLIST_OBJECT_LIST that contains the list of pins for a given component.
* Note: this list *MUST* be sorted by pin number (.m_PinNum member value)
*/
*/
{
{
for
(
unsigned
ii
=
0
;
ii
<
aPinList
.
size
()
-
1
;
ii
++
)
if
(
aPinList
.
size
()
==
0
)
// Trivial case: compnent with no pin
return
;
for
(
unsigned
ii
=
0
;
ii
<
aPinList
.
size
();
ii
++
)
{
{
if
(
aPinList
[
ii
]
==
NULL
)
if
(
aPinList
[
ii
]
==
NULL
)
/* already deleted */
continue
;
/* already deleted */
if
(
aPinList
[
ii
+
1
]
==
NULL
)
continue
;
/* already tested and deleted */
if
(
aPinList
[
ii
]
->
m_PinNum
!=
aPinList
[
ii
+
1
]
->
m_PinNum
)
continue
;
continue
;
/* Duplicated Pins
/* Search for duplicated pins
* remove duplicates. The priority is to keep connected pins and remove unconnected
* If found, remove duplicates. The priority is to keep connected pins and remove unconnected
* So this allows (for instance when using multi op amps per package
* - So this allows (for instance when using multi op amps per package
* to connect only one op amp to power
* - to connect only one op amp to power
* Because the pin list is sorted by m_PinNum value, duplicated pins are necessary successive in list
*/
*/
int
idxref
=
ii
;
int
idxref
=
ii
;
for
(
unsigned
jj
=
ii
+
1
;
jj
<
aPinList
.
size
();
jj
++
)
for
(
unsigned
jj
=
ii
+
1
;
jj
<
aPinList
.
size
();
jj
++
)
{
{
if
(
aPinList
[
jj
]
==
NULL
)
// Already removed
if
(
aPinList
[
jj
]
==
NULL
)
// Already removed
continue
;
continue
;
if
(
aPinList
[
idxref
]
->
m_PinNum
!=
aPinList
[
jj
]
->
m_PinNum
)
if
(
aPinList
[
idxref
]
->
m_PinNum
!=
aPinList
[
jj
]
->
m_PinNum
)
// other pin num => end of duplicate list
break
;
break
;
if
(
aPinList
[
idxref
]
->
m_FlagOfConnection
==
PAD_CONNECT
)
if
(
aPinList
[
idxref
]
->
m_FlagOfConnection
==
PAD_CONNECT
)
aPinList
[
jj
]
=
NULL
;
aPinList
[
jj
]
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment