-
Notifications
You must be signed in to change notification settings - Fork 12
Refactor Neopixel to add decoupling caps, use consistent pwr port naming #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ def _svgpcb_refdes_of(self, block_ref: List[str]) -> Tuple[str, int]: | |
| block_path = self._svgpcb_pathname_data.append_block(*block_ref) | ||
| candidate_blocks = [block for block in self._svgpcb_netlist.blocks | ||
| if block.full_path.startswith(block_path)] | ||
| assert len(candidate_blocks) == 1 | ||
| assert len(candidate_blocks) > 0 | ||
| refdes = candidate_blocks[0].refdes | ||
| assert isinstance(refdes, str) | ||
| assert refdes is not None | ||
|
|
@@ -60,19 +60,19 @@ def _svgpcb_refdes_of(self, block_ref: List[str]) -> Tuple[str, int]: | |
|
|
||
| def _svgpcb_footprint_block_path_of(self, block_ref: List[str]) -> TransformUtil.Path: | ||
| """Infrastructure method, given the name of a container block, returns the block path of the footprint block. | ||
| Asserts there is exactly one.""" | ||
| Picks the first one, which is assumed to be the main / anchor device.""" | ||
| block_path = self._svgpcb_pathname_data.append_block(*block_ref) | ||
| candidate_blocks = [block for block in self._svgpcb_netlist.blocks | ||
| if block.full_path.startswith(block_path)] | ||
| assert len(candidate_blocks) == 1 | ||
| assert len(candidate_blocks) > 0 | ||
|
||
| return candidate_blocks[0].full_path | ||
|
|
||
| def _svgpcb_footprint_of(self, path: TransformUtil.Path) -> str: | ||
| """Infrastructure method, returns the footprint for the output of _svgpcb_footprint_block_path_of. | ||
| If _svgpcb_footprint_block_path_of returned a value, this will return the footprint; otherwise crashes.""" | ||
| candidate_blocks = [block for block in self._svgpcb_netlist.blocks | ||
| if block.full_path == path] | ||
| assert len(candidate_blocks) == 1 | ||
| assert len(candidate_blocks) > 0 | ||
| return self._svgpcb_footprint_to_svgpcb(candidate_blocks[0].footprint) | ||
|
|
||
| def _svgpcb_pin_of(self, block_ref: List[str], pin_ref: List[str]) -> str: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion change from
== 1to> 0allows multiple matching blocks but then unconditionally usescandidate_blocks[0]. This could mask issues where multiple blocks exist but different ones are expected. Consider adding a warning or selecting based on specific criteria when multiple blocks are found.