Repository navigation
pico2w: add bsp module for pin assignments and peripheral groups - #108
Merged
Merged
Conversation
Board::init() configures the clock profile and takes the HAL peripherals, returning them grouped per subsystem (SD, display, buttons, audio, WiFi). Drivers take their group by value, so each peripheral is claimed once and the compiler enforces it. - Move ClockProfile, Irqs/WifiIrqs and WifiPeriphs out of main.rs. - HwDisplay::new borrows DisplayPeriphs via Peri::reborrow, so GameDisplay::new_after_splash no longer needs unsafe steal(). - InputHandler::new takes ButtonPeriphs; init_sd_card takes SdPeriphs. - Add audio::init_i2s for the PIO0 I2S setup previously inline in main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## pico2w-cyw43-firmware-blobs #108 +/- ##
============================================================
Coverage 92.82% 92.82%
============================================================
Files 83 83
Lines 14155 14155
============================================================
Hits 13139 13139
Misses 1016 1016 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Stacked on the firmware-blobs PR; merge that first, then retarget this to
main.Summary
bspmodule (ARM-only).Board::init()sets up the clock profile and HAL, and returns the peripherals grouped per subsystem:SdPeriphs,DisplayPeriphs,ButtonPeriphs,AudioPeriphs,WifiPeriphs. Pin numbers now live only inbsp.rs.main.rs:ClockProfile/CLOCK,Irqs/WifiIrqs,WifiPeriphs.HwDisplay::new(&mut DisplayPeriphs)reborrows viaPeri::reborrow, soGameDisplay::new_after_splashno longer needsunsafe/steal().InputHandler::new(ButtonPeriphs),init_sd_card(SdPeriphs), newaudio::init_i2s(AudioPeriphs, Irqs).Board.sd_power, separate fromSdPeriphs, since boot sequencing toggles it around display init before the card driver exists.Testing
cargo build --releasefor the firmware succeeds with no new warnings.cargo test -p rustyboy-pico2w --lib --testson the host fails to compile, but it fails identically onmain(verified by stashing this change), so no host tests ran against this change.🤖 Generated with Claude Code