Skip to content

Conversation

@TrentHouliston
Copy link
Member

Moves to using Tasks as embassy intends.

Copilot AI review requested due to automatic review settings August 2, 2025 11:04

This comment was marked as outdated.

@TrentHouliston TrentHouliston requested a review from Copilot August 3, 2025 06:54
Copy link
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 refactors the firmware to use Embassy's task-based architecture instead of manually joining async functions in main. The changes move from a monolithic main function using join4 to individual Embassy tasks that are spawned independently.

Key changes:

  • Replace peripheral structs with "Claims" pattern for better ownership management
  • Add Embassy tasks for USB, IMU, ACM echo, and CRC test functionality
  • Introduce static buffer management using static_cell for USB operations
  • Add conditional compilation features for debug applications

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/main.rs Refactored from join-based concurrency to Embassy task spawning pattern
src/peripherals/usb_system.rs Added USB task, static buffers, and renamed struct to UsbClaims
src/peripherals/acm.rs Restructured ACM state management with static allocation
src/peripherals/spi.rs Renamed SpiPeripherals to SpiClaims for consistency
src/drivers/imu/driver.rs Added IMU task wrapper with error recovery
src/apps/*.rs Converted applications to Embassy tasks with renamed structs
Cargo.toml Updated Embassy timer configuration and added feature flags

TrentHouliston and others added 6 commits August 3, 2025 16:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TrentHouliston TrentHouliston added this pull request to the merge queue Aug 3, 2025
Merged via the queue into main with commit f34e692 Aug 3, 2025
9 checks passed
@TrentHouliston TrentHouliston deleted the houliston/tasks branch August 3, 2025 07:07
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