Skip to content

Commit 0ddc575

Browse files
authored
update project files (#17)
Add .cargo/config.toml aliases and documentation to allow easier running of the examples from the project root.
1 parent 601f6fa commit 0ddc575

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

esp-hal-buzzer/.cargo/config.toml renamed to .cargo/config.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ esp32h2 = "run --release --features=esp32h2 --target=riscv32imac-unknown-none-el
77
esp32s2 = "run --release --features=esp32s2 --target=xtensa-esp32s2-none-elf"
88
esp32s3 = "run --release --features=esp32s3 --target=xtensa-esp32s3-none-elf"
99

10+
[build]
11+
target = "riscv32imac-unknown-none-elf"
12+
# target = "riscv32imc-unknown-none-elf"
13+
# target = "xtensa-esp32s2-none-elf"
14+
# target = "xtensa-esp32s3-none-elf"
15+
# target = "xtensa-esp32-none-elf"
16+
1017
[target.'cfg(target_arch = "riscv32")']
1118
runner = "espflash flash --monitor"
1219
rustflags = [
@@ -27,4 +34,4 @@ rustflags = [
2734
]
2835

2936
[unstable]
30-
build-std = ["core"]
37+
build-std = ["alloc", "core"]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ A collection of crates for use alongside [esp-hal], but which are maintained by
88

99
[esp-hal]: https://github.com/esp-rs/esp-hal/
1010

11+
## Examples
12+
13+
To run the examples for either crate, either open the project at the sub-crate level or change directory:
14+
15+
```bash
16+
# cd into crate directory for smartled or buzzer
17+
cd esp-hal-smartled
18+
# cargo <chip alias> --example <example name>
19+
cargo esp32c3 --example hello_rgb # or other chip
20+
```
21+
1122
## Contributing a Crate
1223

1324
If you have a crate which depends on `esp-hal` and provides some additional functionality, we encourage you to contribute it to this repository!

esp-hal-smartled/.cargo/config.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

esp-hal-smartled/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore file because it will be different based on test target.
2+
/rust-toolchain.toml

rust-toolchain-risc-v.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[toolchain]
2+
channel = "stable"
3+
components = ["rust-src"]
4+
targets = ["riscv32imac-unknown-none-elf", "riscv32imac-unknown-none-elf"]

rust-toolchain-xtensa.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "esp"

0 commit comments

Comments
 (0)