diff options
| author | Dániel Buga <[email protected]> | 2024-12-22 00:52:54 +0100 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2024-12-22 00:56:34 +0100 |
| commit | abb42206f2e888fb1ad0eae05b17edfedcb101ad (patch) | |
| tree | 6344e2cdf830c188e3a72c80b69f4cb8eccf2fa6 | |
| parent | 6789b5141f9280f1e3d7c6dfcab1a07fe4620b43 (diff) | |
Add generic-queue-* features back to embassy-time
| -rw-r--r-- | embassy-time-queue-driver/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-time-queue-driver/src/lib.rs | 3 | ||||
| -rw-r--r-- | embassy-time/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | embassy-time/Cargo.toml | 25 |
4 files changed, 27 insertions, 4 deletions
diff --git a/embassy-time-queue-driver/Cargo.toml b/embassy-time-queue-driver/Cargo.toml index a104f5c39..7fa91bb0c 100644 --- a/embassy-time-queue-driver/Cargo.toml +++ b/embassy-time-queue-driver/Cargo.toml | |||
| @@ -36,7 +36,7 @@ embassy-executor = { version = "0.6.3", path = "../embassy-executor" } | |||
| 36 | #! The features also set how many timers are used for the generic queue. At most one | 36 | #! The features also set how many timers are used for the generic queue. At most one |
| 37 | #! `generic-queue-*` feature can be enabled. If none is enabled, a default of 64 timers is used. | 37 | #! `generic-queue-*` feature can be enabled. If none is enabled, a default of 64 timers is used. |
| 38 | #! | 38 | #! |
| 39 | #! When using embassy-time from libraries, you should *not* enable any `generic-queue-*` feature, to allow the | 39 | #! When using embassy-time-queue-driver from libraries, you should *not* enable any `generic-queue-*` feature, to allow the |
| 40 | #! end user to pick. | 40 | #! end user to pick. |
| 41 | 41 | ||
| 42 | ## Generic Queue with 8 timers | 42 | ## Generic Queue with 8 timers |
diff --git a/embassy-time-queue-driver/src/lib.rs b/embassy-time-queue-driver/src/lib.rs index 333b6124d..72453f0ea 100644 --- a/embassy-time-queue-driver/src/lib.rs +++ b/embassy-time-queue-driver/src/lib.rs | |||
| @@ -4,8 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | //! This crate is an implementation detail of `embassy-time-driver`. | 5 | //! This crate is an implementation detail of `embassy-time-driver`. |
| 6 | //! | 6 | //! |
| 7 | //! As a HAL user, you should only depend on this crate if your application does not use | 7 | //! As a HAL user, you should not need to depend on this crate directly. |
| 8 | //! `embassy-executor` and your HAL does not configure a generic queue by itself. | ||
| 9 | //! | 8 | //! |
| 10 | //! As a HAL implementer, you need to depend on this crate if you want to implement a time driver, | 9 | //! As a HAL implementer, you need to depend on this crate if you want to implement a time driver, |
| 11 | //! but how you should do so is documented in `embassy-time-driver`. | 10 | //! but how you should do so is documented in `embassy-time-driver`. |
diff --git a/embassy-time/CHANGELOG.md b/embassy-time/CHANGELOG.md index a6acb1ad6..0026fbd08 100644 --- a/embassy-time/CHANGELOG.md +++ b/embassy-time/CHANGELOG.md | |||
| @@ -7,7 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
| 7 | 7 | ||
| 8 | ## Unreleased | 8 | ## Unreleased |
| 9 | 9 | ||
| 10 | - The `generic-queue` and related features have been removed (moved to embassy-time-queue-driver) | ||
| 11 | - embassy-time no longer provides an `embassy-time-queue-driver` implementation | 10 | - embassy-time no longer provides an `embassy-time-queue-driver` implementation |
| 12 | 11 | ||
| 13 | ## 0.3.2 - 2024-08-05 | 12 | ## 0.3.2 - 2024-08-05 |
diff --git a/embassy-time/Cargo.toml b/embassy-time/Cargo.toml index 4f4ea0b14..eeac7dc29 100644 --- a/embassy-time/Cargo.toml +++ b/embassy-time/Cargo.toml | |||
| @@ -42,6 +42,31 @@ defmt-timestamp-uptime-tus = ["defmt"] | |||
| 42 | ## Create a `MockDriver` that can be manually advanced for testing purposes. | 42 | ## Create a `MockDriver` that can be manually advanced for testing purposes. |
| 43 | mock-driver = ["tick-hz-1_000_000", "dep:embassy-time-queue-driver"] | 43 | mock-driver = ["tick-hz-1_000_000", "dep:embassy-time-queue-driver"] |
| 44 | 44 | ||
| 45 | #! ### Generic Queue | ||
| 46 | |||
| 47 | #! By default embassy-time uses a timer queue implementation that is faster but depends on `embassy-executor`. | ||
| 48 | #! It will panic if you try to await any timer when using another executor. | ||
| 49 | #! | ||
| 50 | #! Alternatively, you can choose to use a "generic" timer queue implementation that works on any executor. | ||
| 51 | #! To enable it, enable any of the features below. | ||
| 52 | #! | ||
| 53 | #! The features also set how many timers are used for the generic queue. At most one | ||
| 54 | #! `generic-queue-*` feature can be enabled. If none is enabled, a default of 64 timers is used. | ||
| 55 | #! | ||
| 56 | #! When using embassy-time from libraries, you should *not* enable any `generic-queue-*` feature, to allow the | ||
| 57 | #! end user to pick. | ||
| 58 | |||
| 59 | ## Generic Queue with 8 timers | ||
| 60 | generic-queue-8 = ["embassy-time-queue-driver/generic-queue-8"] | ||
| 61 | ## Generic Queue with 16 timers | ||
| 62 | generic-queue-16 = ["embassy-time-queue-driver/generic-queue-16"] | ||
| 63 | ## Generic Queue with 32 timers | ||
| 64 | generic-queue-32 = ["embassy-time-queue-driver/generic-queue-32"] | ||
| 65 | ## Generic Queue with 64 timers | ||
| 66 | generic-queue-64 = ["embassy-time-queue-driver/generic-queue-64"] | ||
| 67 | ## Generic Queue with 128 timers | ||
| 68 | generic-queue-128 = ["embassy-time-queue-driver/generic-queue-128"] | ||
| 69 | |||
| 45 | #! ### Tick Rate | 70 | #! ### Tick Rate |
| 46 | #! | 71 | #! |
| 47 | #! At most 1 `tick-*` feature can be enabled. If none is enabled, a default of 1MHz is used. | 72 | #! At most 1 `tick-*` feature can be enabled. If none is enabled, a default of 1MHz is used. |
