Skip to content

7 embedded platform implementation#20

Merged
lxsaah merged 15 commits into
mainfrom
7-embedded-platform-implementation
Sep 27, 2025
Merged

7 embedded platform implementation#20
lxsaah merged 15 commits into
mainfrom
7-embedded-platform-implementation

Conversation

@lxsaah
Copy link
Copy Markdown
Contributor

@lxsaah lxsaah commented Sep 27, 2025

Closes #7

Added

  • Embassy adapter for embedded systems with async runtime support
  • Hardware error constructors
  • No-std compatibility with zero heap allocation error handling

Changed

  • Default features changed from ["std"] to [] for embedded-first approach
  • Enhanced Makefile with separate std/no_std build workflows
  • Error handling optimized for <64 byte memory footprint

Fixed

  • No-std build compatibility for embedded targets
  • Feature unification issues with embassy adapter

@lxsaah lxsaah requested a review from Copilot September 27, 2025 18:58
@lxsaah lxsaah linked an issue Sep 27, 2025 that may be closed by this pull request
5 tasks
@lxsaah lxsaah self-assigned this Sep 27, 2025
@lxsaah lxsaah added the 🏗️ core Core engine work label Sep 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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

Comment thread aimdb-embassy-adapter/build.rs Outdated
Comment thread aimdb-embassy-adapter/src/error.rs
@lxsaah lxsaah requested a review from Copilot September 27, 2025 19:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comment thread aimdb-embassy-adapter/src/error.rs
Comment thread aimdb-embassy-adapter/src/error.rs Outdated
Comment thread aimdb-embassy-adapter/src/error.rs Outdated
Comment thread aimdb-embassy-adapter/build.rs Outdated
@lxsaah lxsaah requested a review from Copilot September 27, 2025 19:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

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");
}
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@lxsaah lxsaah merged commit fda80fe into main Sep 27, 2025
4 checks passed
@lxsaah lxsaah deleted the 7-embedded-platform-implementation branch September 27, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏗️ core Core engine work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedded Platform Implementation

2 participants