Fix build without any queue impl selected
This commit is contained in:
parent
7c64ff0b87
commit
d22660b2f3
@ -21,7 +21,7 @@ embassy-executor = { version = "0.6.3", optional = true }
|
||||
embassy-sync = { version = "0.6.1" }
|
||||
embassy-time = { version = "0.3.0" }
|
||||
embassy-time-driver = { version = "0.1.0", features = [ "tick-hz-1_000_000" ] }
|
||||
embassy-time-queue-driver = { version = "0.1.0" }
|
||||
embassy-time-queue-driver = { version = "0.1.0", features = ["generic-queue-const-generic"] }
|
||||
esp-config = { version = "0.2.0", path = "../esp-config" }
|
||||
esp-hal = { version = "0.22.0", path = "../esp-hal" }
|
||||
log = { version = "0.4.22", optional = true }
|
||||
@ -55,7 +55,7 @@ executors = ["dep:embassy-executor", "esp-hal/__esp_hal_embassy"]
|
||||
integrated-timers = ["embassy-executor?/integrated-timers", "executors"]
|
||||
## Implement a generic timer queue. This option is useful if you intend to use a different executor
|
||||
## than `embassy-executor`.
|
||||
generic-queue = ["single-queue", "embassy-time-queue-driver/generic-queue-const-generic"]
|
||||
generic-queue = ["single-queue"]
|
||||
## Use a single, global timer queue. This option only needs a single alarm, no matter how many
|
||||
## executors are used.
|
||||
single-queue = []
|
||||
|
||||
@ -250,14 +250,14 @@ fn not_enough_timers() -> ! {
|
||||
}
|
||||
|
||||
pub(crate) struct TimerQueueDriver {
|
||||
#[cfg(feature = "single-queue")]
|
||||
#[cfg(any(feature = "single-queue", not(feature = "integrated-timers")))]
|
||||
pub(crate) inner: crate::timer_queue::TimerQueue,
|
||||
}
|
||||
|
||||
impl TimerQueueDriver {
|
||||
const fn new() -> Self {
|
||||
Self {
|
||||
#[cfg(feature = "single-queue")]
|
||||
#[cfg(any(feature = "single-queue", not(feature = "integrated-timers")))]
|
||||
inner: crate::timer_queue::TimerQueue::new(Priority::max()),
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ impl embassy_time_queue_driver::TimerQueue for crate::time_driver::TimerQueueDri
|
||||
#[cfg(feature = "integrated-timers")]
|
||||
let waker = embassy_executor::raw::task_from_waker(waker);
|
||||
|
||||
#[cfg(not(feature = "single-queue"))]
|
||||
#[cfg(all(feature = "integrated-timers", not(feature = "single-queue")))]
|
||||
unsafe {
|
||||
let executor = &*(waker.executor().unwrap_unchecked()
|
||||
as *const embassy_executor::raw::Executor)
|
||||
@ -79,7 +79,7 @@ impl embassy_time_queue_driver::TimerQueue for crate::time_driver::TimerQueueDri
|
||||
executor.timer_queue.schedule_wake(waker, at);
|
||||
}
|
||||
|
||||
#[cfg(feature = "single-queue")]
|
||||
#[cfg(any(feature = "single-queue", not(feature = "integrated-timers")))]
|
||||
self.inner.schedule_wake(waker, at);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ esp32s3 = ["esp-hal/esp32s3", "esp-backtrace/esp32s3", "esp-hal-embassy?/esp32s3
|
||||
esp-wifi = ["dep:esp-wifi"]
|
||||
|
||||
embassy = ["dep:esp-hal-embassy"]
|
||||
embassy-generic-timers = ["embassy-time/generic-queue-8"]
|
||||
embassy-generic-queue = ["esp-hal-embassy/generic-queue"]
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user