Skip to content

Commit

Permalink
Initial commit, fails with the following though:
Browse files Browse the repository at this point in the history
$ cargo build
  Downloaded as5600 v0.6.0
  Downloaded 1 crate (14.1 KB) in 0.85s
   Compiling autocfg v1.1.0
   Compiling num-derive v0.4.2
   Compiling nb v0.1.3
   Compiling embedded-hal v0.2.7
   Compiling num-traits v0.2.18
   Compiling as5600 v0.6.0
   Compiling embassy-avr-as5600-encoder v0.1.0 (/home/rvalls/dev/personal/embassy-avr-as5600-encoder)
error[E0658]: `impl Trait` in associated types is unstable
 --> src/main.rs:8:1
  |
8 | #[embassy_executor::main]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #63063 <rust-lang/rust#63063> for more information
  = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
  = note: this compiler was built on 2024-03-23; consider upgrading it if it is out of date
  = note: this error originates in the attribute macro `::embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0658`.
error: could not compile `embassy-avr-as5600-encoder` (bin "embassy-avr-as5600-encoder") due to 1 previous error
  • Loading branch information
brainstorm committed Mar 24, 2024
0 parents commit eb5f848
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build]
target = "avr-specs/avr-atmega328p.json"
[unstable]
build-std = ["core"]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
Cargo.lock
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
edition = "2021"
name = "embassy-avr-as5600-encoder"
version = "0.1.0"
authors = ["brainstorm <brainstorm@nopcode.org>"]
resolver = "2"

[dependencies]
panic-halt = "0.2"
embassy-executor = { git = "https://github.com/embassy-rs/embassy", features = ["arch-avr", "nightly", "executor-thread"] }
avr-device = { version = "0.5", features = ["atmega328p", "rt"] }
as5600 = "0.6.0"

[profile.dev]
panic = "abort"
lto = true
opt-level = "s"

[profile.release]
panic = "abort"
codegen-units = 1
lto = true
opt-level = "s"
25 changes: 25 additions & 0 deletions avr-specs/avr-atmega328p.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"arch": "avr",
"atomic-cas": false,
"cpu": "atmega328p",
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
"eh-frame-header": false,
"exe-suffix": ".elf",
"late-link-args": {
"gcc": [
"-lgcc"
]
},
"linker": "avr-gcc",
"llvm-target": "avr-unknown-unknown",
"max-atomic-width": 8,
"no-default-libraries": false,
"pre-link-args": {
"gcc": [
"-mmcu=atmega328p"
]
},
"relocation-model": "static",
"target-c-int-width": "16",
"target-pointer-width": "16"
}
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly"
components = ["rust-src"]
profile = "minimal"
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_std]
#![no_main]

use panic_halt as _;

use embassy_executor::Spawner;

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
loop {}
}

0 comments on commit eb5f848

Please sign in to comment.