-
Notifications
You must be signed in to change notification settings - Fork 37
Implement restriction-based pin filtering #298
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
base: main
Are you sure you want to change the base?
Conversation
f8191ac to
7eeae0a
Compare
ea73bce to
9c7eb47
Compare
|
Oh yeah this PR will fail up until the next esp-hal release... |
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.
Pull request overview
This PR implements restriction-based pin filtering for ESP32 modules, replacing the dependency on esp-metadata with esp-metadata-generated from esp-hal. The system now uses pin limitation metadata to automatically filter out pins that are restricted by specific module configurations (flash, PSRAM, etc.) rather than hardcoding GPIO numbers.
Changes:
- Replaced
esp-metadatadependency withesp-metadata-generatedfrom esp-hal - Introduced a new
Chipenum wrapper that bridges to the metadata library and provides module lookup functionality - Refactored module definitions to use string-based pin limitation tags instead of hardcoded GPIO numbers
- Updated template generation to compute reserved GPIO code based on pin limitations
Reviewed changes
Copilot reviewed 13 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Added new Chip enum with methods to access metadata, modules, pins, and memory regions |
| src/modules.rs | Completely refactored module definitions to use remove_pins with limitation tags; organized modules by chip into separate constants |
| src/main.rs | Updated to use new Chip API and generate reserved GPIO code by filtering pins based on module limitations |
| src/toolchain.rs | Updated to call chip.metadata() methods instead of direct chip methods |
| src/tui.rs | Changed import from esp_metadata::Chip to crate::Chip |
| src/template.rs | Changed import from esp_metadata::Chip to crate::Chip |
| src/config.rs | Changed import from esp_metadata::Chip to crate::Chip |
| src/check.rs | Changed to use esp_metadata_generated::Chip directly |
| src/module_selector.rs | Removed file (functionality moved to src/main.rs) |
| template/src/bin/main.rs | Simplified template to always include reserved GPIO code placeholder |
| template/src/bin/async_main.rs | Simplified template to always include reserved GPIO code placeholder |
| Cargo.toml | Updated dependency from esp-metadata to esp-metadata-generated from git |
| Cargo.lock | Reflected dependency changes |
| xtask/src/main.rs | Updated import to use esp_generate::Chip |
| xtask/Cargo.toml | Removed esp-metadata dependency |
| xtask/Cargo.lock | Reflected dependency changes |
| CHANGELOG.md | Added entry for module selector feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I still need to add the actual module info and wait for #297 to get log output for the CI failures, but the rough draft is now visible here.