aboutsummaryrefslogtreecommitdiff
path: root/embassy-time-queue-driver
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-12-09 00:28:14 +0100
committerDániel Buga <[email protected]>2024-12-15 18:49:57 +0100
commit2f2e2c6031a1abaecdac5ed2febe109e647fe6fd (patch)
tree57ecbf9d7c0ab5e9439f12aedeaa58d0156d1605 /embassy-time-queue-driver
parentb268b1795fed58544c166c41842ce0d66328aa3e (diff)
Make `integrated-timers` the default, remove Cargo feature.
Diffstat (limited to 'embassy-time-queue-driver')
-rw-r--r--embassy-time-queue-driver/Cargo.toml29
-rw-r--r--embassy-time-queue-driver/src/lib.rs11
2 files changed, 20 insertions, 20 deletions
diff --git a/embassy-time-queue-driver/Cargo.toml b/embassy-time-queue-driver/Cargo.toml
index 599041a3f..7a10e29b4 100644
--- a/embassy-time-queue-driver/Cargo.toml
+++ b/embassy-time-queue-driver/Cargo.toml
@@ -23,35 +23,36 @@ links = "embassy-time-queue"
23[dependencies] 23[dependencies]
24critical-section = "1.2.0" 24critical-section = "1.2.0"
25heapless = "0.8" 25heapless = "0.8"
26embassy-executor = { version = "0.6.3", path = "../embassy-executor", optional = true } 26embassy-executor = { version = "0.6.3", path = "../embassy-executor" }
27embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver" } 27embassy-time-driver = { version = "0.1.0", path = "../embassy-time-driver" }
28 28
29[features] 29[features]
30#! ### Generic Queue 30#! ### Generic Queue
31 31
32## Use the executor-integrated `embassy-time` timer queue. The timer items are stored inside 32#! By default this crate uses a timer queue implementation that is faster but depends on `embassy-executor`.
33## the task headers, so you do not need to set a capacity for the queue. 33#! It will panic if you try to await any timer when using another executor.
34## To use this you must have a time driver provided. 34#!
35## 35#! Alternatively, you can choose to use a "generic" timer queue implementation that works on any executor.
36## If this feature is not enabled, a generic queue is available with a configurable capacity. 36#! To enable it, enable any of the features below.
37integrated-timers = ["embassy-executor/integrated-timers"] 37#!
38 38#! The features also set how many timers are used for the generic queue. At most one
39#! The following features set how many timers are used for the generic queue. At most one
40#! `generic-queue-*` feature can be enabled. If none is enabled, a default of 64 timers is used. 39#! `generic-queue-*` feature can be enabled. If none is enabled, a default of 64 timers is used.
41#! 40#!
42#! When using embassy-time from libraries, you should *not* enable any `generic-queue-*` feature, to allow the 41#! When using embassy-time from libraries, you should *not* enable any `generic-queue-*` feature, to allow the
43#! end user to pick. 42#! end user to pick.
44 43
45## Generic Queue with 8 timers 44## Generic Queue with 8 timers
46generic-queue-8 = [] 45generic-queue-8 = ["_generic-queue"]
47## Generic Queue with 16 timers 46## Generic Queue with 16 timers
48generic-queue-16 = [] 47generic-queue-16 = ["_generic-queue"]
49## Generic Queue with 32 timers 48## Generic Queue with 32 timers
50generic-queue-32 = [] 49generic-queue-32 = ["_generic-queue"]
51## Generic Queue with 64 timers 50## Generic Queue with 64 timers
52generic-queue-64 = [] 51generic-queue-64 = ["_generic-queue"]
53## Generic Queue with 128 timers 52## Generic Queue with 128 timers
54generic-queue-128 = [] 53generic-queue-128 = ["_generic-queue"]
54
55_generic-queue = []
55 56
56[package.metadata.embassy_docs] 57[package.metadata.embassy_docs]
57src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-queue-driver-v$VERSION/embassy-time-queue-driver/src/" 58src_base = "https://github.com/embassy-rs/embassy/blob/embassy-time-queue-driver-v$VERSION/embassy-time-queue-driver/src/"
diff --git a/embassy-time-queue-driver/src/lib.rs b/embassy-time-queue-driver/src/lib.rs
index ed490a0ef..46dd646ca 100644
--- a/embassy-time-queue-driver/src/lib.rs
+++ b/embassy-time-queue-driver/src/lib.rs
@@ -51,16 +51,15 @@
51 51
52use core::task::Waker; 52use core::task::Waker;
53 53
54#[cfg(not(feature = "integrated-timers"))] 54#[cfg(feature = "_generic-queue")]
55pub mod queue_generic; 55pub mod queue_generic;
56#[cfg(feature = "integrated-timers")] 56#[cfg(not(feature = "_generic-queue"))]
57pub mod queue_integrated; 57pub mod queue_integrated;
58 58
59#[cfg(feature = "integrated-timers")] 59#[cfg(feature = "_generic-queue")]
60pub use queue_integrated::Queue;
61
62#[cfg(not(feature = "integrated-timers"))]
63pub use queue_generic::Queue; 60pub use queue_generic::Queue;
61#[cfg(not(feature = "_generic-queue"))]
62pub use queue_integrated::Queue;
64 63
65extern "Rust" { 64extern "Rust" {
66 fn _embassy_time_schedule_wake(at: u64, waker: &Waker); 65 fn _embassy_time_schedule_wake(at: u64, waker: &Waker);