-
Notifications
You must be signed in to change notification settings - Fork 861
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
base: main
Are you sure you want to change the base?
Conversation
d8ab606
to
4f4fb7e
Compare
4f4fb7e
to
0578870
Compare
@@ -0,0 +1,8 @@ | |||
[build] | |||
target = "avr-unknown-gnu-atmega328" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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.