7 embedded platform implementation#20
Merged
Merged
Conversation
…ks for std environments
5 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements Embassy adapter support for embedded platforms with no_std compatibility, introducing hardware-specific error handling for MCU environments while changing the default feature configuration to be embedded-first.
Key changes:
- Added Embassy adapter with hardware error constructors for embedded peripherals (SPI, I2C, UART, etc.)
- Changed default features from
["std"]to[]for embedded-first approach - Enhanced build system to support separate std/no_std compilation workflows
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| aimdb-embassy-adapter/src/lib.rs | New Embassy adapter with comprehensive documentation and no_std-only compilation |
| aimdb-embassy-adapter/src/error.rs | Hardware error handling traits and conversions for embedded-hal peripherals |
| aimdb-embassy-adapter/build.rs | Build script enforcing no_std compilation with embedded target optimizations |
| aimdb-embassy-adapter/Cargo.toml | Package configuration with Embassy dependencies and embedded feature flags |
| aimdb-core/src/lib.rs | Added conditional no_std support |
| aimdb-core/src/error.rs | Conditional test compilation for std/no_std feature compatibility |
| aimdb-core/Cargo.toml | Changed default features and added embedded feature flag |
| Makefile | Enhanced build system with separate std/no_std workflows and embedded testing |
| Cargo.toml | Added Embassy dependencies and embassy adapter to workspace |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines
+39
to
+50
| // Check for GNU ld specifically, avoiding false positives with lld or paths containing 'ld' | ||
| let linker_name = linker | ||
| .split('/') | ||
| .next_back() | ||
| .unwrap_or(&linker) | ||
| .split('\\') | ||
| .next_back() | ||
| .unwrap_or(&linker); | ||
|
|
||
| if linker_name == "ld" || linker_name.starts_with("arm-") && linker_name.ends_with("-ld") { | ||
| println!("cargo:rustc-link-arg=-Wl,--gc-sections"); | ||
| } |
There was a problem hiding this comment.
The linker detection logic is overly complex and fragile. The nested split() operations with next_back() make it difficult to understand and maintain. Consider using Path::file_stem() from std::path for cleaner path parsing, or simplify the logic to check for common linker patterns more directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Added
Changed
["std"]to[]for embedded-first approachFixed