Skip to content

Commit 897e32e

Browse files
committed
Do not depend on embassy-time directly
1 parent 945ca7c commit 897e32e

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ log = { version = "0.4", default-features = false }
2323
futures-io = { version = "0.3", default-features = false, optional = true, features = ["std"] }
2424
futures-lite = { version = "2", default-features = false, optional = true }
2525
embassy-time-driver = { version = "0.2", optional = true }
26-
embassy-time = { version = "0.4", optional = true }
2726

2827
[dev-dependencies]
2928
futures-io = "0.3"
3029
futures-lite = "2"
31-
embassy-time = { version = "0.4", features = ["std"] }
32-
embassy-time-queue-utils = { version = "0.1", features = ["generic-queue-64"] }
30+
embassy-time = { version = "0.4", features = ["std", "generic-queue-64"] }
3331
async-channel = "2"
3432
env_logger = "0.10"
3533

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Further, `async-io` has a non-trivial set of dependencies (again - for MCUs; for
3939

4040
## Enhancements
4141

42-
The `Timer` type of `async_io_mini` is based on the `embassy-time` crate, and as such should offer a higher resolution on embedded operating systems like the ESP-IDF than what can be normally achieved by implementing timers using the `timeout` parameter of the `select` syscall (as `async-io` does).
42+
The `Timer` type of `async_io_mini` is based on the `embassy-time` crate, and as such should offer a higher resolution on embedded operating systems like the ESP-IDF than what can be normally achieved by implementing timers using the `timeout` parameter of the `select` syscall (as `async-io` does).
4343

4444
The reason for this is that on the ESP-IDF, the `timeout` parameter of `select` provides a resolution of 10ms (one FreeRTOS sys-tick), while
4545
`embassy-time` is implemented using the [ESP-IDF Timer service](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/esp_timer.html), which provides resolutions up to 1 microsecond.
@@ -64,7 +64,7 @@ To wait for the next I/O event, the "async-io-mini" thread uses the [select](htt
6464

6565
### Timer
6666

67-
As per above, the `Timer` type is a wrapper around the functionality provided by the `embassy-time` crate.
67+
As per above, the `Timer` type is a wrapper around the functionality provided by the `embassy-time` crate. This means your application needs to select and use an `embassy-time-driver` implementation. Such an implementation is provided by HAL crates, or `embassy-time` implements one for `std`.
6868

6969
## Examples
7070

src/timer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ impl Timer {
9292
/// # });
9393
/// ```
9494
pub fn never() -> Timer {
95-
let _fix_linking = embassy_time::Timer::after(embassy_time::Duration::from_secs(1));
96-
9795
Timer {
9896
when: None,
9997
period: Duration::MAX,

0 commit comments

Comments
 (0)