Skip to content
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

[avr] create initial example #3696

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

tones111
Copy link
Contributor

This commit adds a minimal example demonstrating how to create an embassy executor. This gets the infrastructure in place for future work to add missing pieces like a timer driver.

@tones111 tones111 force-pushed the avr_example branch 2 times, most recently from d8ab606 to 4f4fb7e Compare December 30, 2024 05:06
@@ -0,0 +1,8 @@
[build]
target = "avr-unknown-gnu-atmega328"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should the example directory name more closely match the rustc target (avr -> atmega328)?

Currently nightly only supports this target, but avr-hal maintains some additional spec files. I'm unsure if these will all end up being their own rustc platforms, if they can drop the gnu dependency, or if they can be consolidated under a more generic name.

I'm assuming any AVR support here would only use rustc supported targets, otherwise this repo would likely need to duplicate the spec files.

Copy link
Contributor Author

@tones111 tones111 Jan 2, 2025

Choose a reason for hiding this comment

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

I've learned of some progress regarding rustc avr target support.
rust-lang/rust#131651

The proposal consolidates the avr processors into one avr-unknown-unknown or avr-unknown-none target.

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
loop {
// TODO
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Toggling a pin using avr-device is easy enough, but the big hang up here is lack of an AVR time driver.

Is there interest in implementing/supporting an embassy-specific AVR hal, or should the examples make use of avr-hal? Does embassy attempt to have a consistent feel across its HALs?

One challenge is that none of the AVR HAL crates have been published, so git dependencies are needed. I'm also unsure how well it's design aligns with the HALs here.

@lulf lulf mentioned this pull request Jan 11, 2025
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.

1 participant