Skip to content

Commit 7e0e20f

Browse files
committed
Document the AVR_CPU_FREQUENCY_HZ environment variable in the README
1 parent f81e89d commit 7e0e20f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88
The intent of this library is to provide avr specific delay routines similar to the ones provided by the arduino library. The public functions are:
99

10-
**NOTE**: This library currently hardcodes the microcontroller frequency to 16MHz. This will not always be correct. See [avr-rust/delay#2](https://github.com/avr-rust/delay/issues/2) for more details.
10+
## `$AVR_CPU_FREQUENCY_HZ`
11+
12+
This crate uses the [`avr-config`](https://crates.io/crates/avr-config) crate for fetching the CPU frequency. As such, the `AVR_CPU_FREQUENCY_HZ` environment variable will need to be set when compiling your crate for AVR.
13+
14+
Example:
15+
16+
```bash
17+
export AVR_CPU_FREQUENCY_HZ=16000000
18+
cargo build -Z build-std=core --target avr-atmega328p.json --release
19+
```
1120

1221
```rust
1322
delay(count: u32)

0 commit comments

Comments
 (0)