Skip to content

Refactor code structure for improved readability and maintainability#2

Open
peterus wants to merge 2 commits into
mainfrom
first_kicad_version
Open

Refactor code structure for improved readability and maintainability#2
peterus wants to merge 2 commits into
mainfrom
first_kicad_version

Conversation

@peterus

@peterus peterus commented Jan 11, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 11, 2026 17:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread stm32.kicad_sch Outdated
)
(label "BUTTON_DOWN"
(at 121.92 129.54 0)
(at 121.92 132.08 0)

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
(at 121.92 132.08 0)
(at 121.92 129.54 0)

Copilot uses AI. Check for mistakes.
Comment thread power_switch.kicad_sch
Comment on lines +585 to +588
(no_connect
(at 144.78 88.9)
(uuid "b1a8bf55-7982-47ac-8f17-e3037d6e179b")
)

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
(no_connect
(at 144.78 88.9)
(uuid "b1a8bf55-7982-47ac-8f17-e3037d6e179b")
)

Copilot uses AI. Check for mistakes.
Comment thread main.kicad_pro

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants