Refactor code structure for improved readability and maintainability#2
Refactor code structure for improved readability and maintainability#2peterus wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors KiCad hardware design files to improve structure and readability. The changes include significant modifications to the STM32 microcontroller schematic, power supply circuits, and project configuration.
Changes:
- Restructured STM32 schematic with new voltage sensing circuit using resistor divider, remapped I2C and button GPIO pins, and added pull-up resistors for I2C lines
- Modified power supply circuits by removing PWR_FLAG symbols, updating capacitor values from mixed 1uF/4.7uF to uniform 4.7uF X5R capacitors
- Updated ERC configuration to ignore footprint link issues and treat pin-to-pin connections as errors, added new footprints for connectors and crystal, and defined PCB board edge
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| stm32.kicad_sch | Major refactoring with voltage divider circuit addition, GPIO pin remapping for I2C and buttons, new I2C pull-up resistors, and multiple no_connect markers |
| power_switch.kicad_sch | Removed PWR_FLAG symbol, changed capacitor values to 4.7uF X5R, added no_connect marker |
| power.kicad_sch | Removed PWR_FLAG symbol definition and associated connections |
| main.kicad_pro | Modified ERC settings to ignore footprint link issues and set pin_to_pin as error |
| main.kicad_pcb | Updated grid origin and added board edge cut rectangle |
| footprints/PCN10-20P-2.54DS.kicad_mod | New 20-pin DIN connector footprint |
| footprints/M49S-SMD.kicad_mod | New SMD crystal footprint |
| .gitignore | Added output/ directory exclusion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| (label "BUTTON_DOWN" | ||
| (at 121.92 129.54 0) | ||
| (at 121.92 132.08 0) |
There was a problem hiding this comment.
The button labels have been shifted: BUTTON_UP moved from 121.92 124.46 to 121.92 127, BUTTON_OK moved from 121.92 127 to 121.92 129.54, and BUTTON_DOWN moved from 121.92 129.54 to 121.92 132.08. This suggests the MCU pins for these buttons have been reassigned. Verify that the new pin assignments are valid for GPIO input with the required pull-up/pull-down configurations.
| (at 121.92 132.08 0) | |
| (at 121.92 129.54 0) |
| (no_connect | ||
| (at 144.78 88.9) | ||
| (uuid "b1a8bf55-7982-47ac-8f17-e3037d6e179b") | ||
| ) |
There was a problem hiding this comment.
A new no_connect marker was added at position 144.78 88.9, replacing what appears to have been a connection to a PWR_FLAG. This changes the electrical connectivity of the circuit. Ensure this is intentional and that the pin at this location is indeed meant to be unconnected.
| (no_connect | |
| (at 144.78 88.9) | |
| (uuid "b1a8bf55-7982-47ac-8f17-e3037d6e179b") | |
| ) |
No description provided.