Skip to content

Commit eb5f848

Browse files
committed
Initial commit, fails with the following though:
$ 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
0 parents  commit eb5f848

File tree

6 files changed

+69
-0
lines changed

6 files changed

+69
-0
lines changed

.cargo/config.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
target = "avr-specs/avr-atmega328p.json"
3+
[unstable]
4+
build-std = ["core"]

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
Cargo.lock

Cargo.toml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
edition = "2021"
3+
name = "embassy-avr-as5600-encoder"
4+
version = "0.1.0"
5+
authors = ["brainstorm <[email protected]>"]
6+
resolver = "2"
7+
8+
[dependencies]
9+
panic-halt = "0.2"
10+
embassy-executor = { git = "https://github.com/embassy-rs/embassy", features = ["arch-avr", "nightly", "executor-thread"] }
11+
avr-device = { version = "0.5", features = ["atmega328p", "rt"] }
12+
as5600 = "0.6.0"
13+
14+
[profile.dev]
15+
panic = "abort"
16+
lto = true
17+
opt-level = "s"
18+
19+
[profile.release]
20+
panic = "abort"
21+
codegen-units = 1
22+
lto = true
23+
opt-level = "s"

avr-specs/avr-atmega328p.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"arch": "avr",
3+
"atomic-cas": false,
4+
"cpu": "atmega328p",
5+
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
6+
"eh-frame-header": false,
7+
"exe-suffix": ".elf",
8+
"late-link-args": {
9+
"gcc": [
10+
"-lgcc"
11+
]
12+
},
13+
"linker": "avr-gcc",
14+
"llvm-target": "avr-unknown-unknown",
15+
"max-atomic-width": 8,
16+
"no-default-libraries": false,
17+
"pre-link-args": {
18+
"gcc": [
19+
"-mmcu=atmega328p"
20+
]
21+
},
22+
"relocation-model": "static",
23+
"target-c-int-width": "16",
24+
"target-pointer-width": "16"
25+
}

rust-toolchain.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[toolchain]
2+
channel = "nightly"
3+
components = ["rust-src"]
4+
profile = "minimal"

src/main.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![no_std]
2+
#![no_main]
3+
4+
use panic_halt as _;
5+
6+
use embassy_executor::Spawner;
7+
8+
#[embassy_executor::main]
9+
async fn main(_spawner: Spawner) {
10+
loop {}
11+
}

0 commit comments

Comments
 (0)