diff options
| author | Chris Price <[email protected]> | 2024-01-09 17:36:39 +0000 |
|---|---|---|
| committer | Chris Price <[email protected]> | 2024-01-09 17:39:02 +0000 |
| commit | 3db8655e25bf40d0f0b72e557a8d6e3d156119c8 (patch) | |
| tree | 66ab7107d5a741cee62244dd2440748d0b9d59fb /embassy-time | |
| parent | 372a9b28334221f301b698cce09c206aca4df9a4 (diff) | |
Ignore the doctest driver registration to prevent duplicate registrations
Diffstat (limited to 'embassy-time')
| -rw-r--r-- | embassy-time/src/driver.rs | 4 | ||||
| -rw-r--r-- | embassy-time/src/queue.rs | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/embassy-time/src/driver.rs b/embassy-time/src/driver.rs index 2afa454fe..f966386b7 100644 --- a/embassy-time/src/driver.rs +++ b/embassy-time/src/driver.rs | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | //! use embassy_time::driver::{Driver, AlarmHandle}; | 42 | //! use embassy_time::driver::{Driver, AlarmHandle}; |
| 43 | //! | 43 | //! |
| 44 | //! struct MyDriver{} // not public! | 44 | //! struct MyDriver{} // not public! |
| 45 | //! embassy_time::time_driver_impl!(static DRIVER: MyDriver = MyDriver{}); | ||
| 46 | //! | 45 | //! |
| 47 | //! impl Driver for MyDriver { | 46 | //! impl Driver for MyDriver { |
| 48 | //! fn now(&self) -> u64 { | 47 | //! fn now(&self) -> u64 { |
| @@ -59,6 +58,9 @@ | |||
| 59 | //! } | 58 | //! } |
| 60 | //! } | 59 | //! } |
| 61 | //! ``` | 60 | //! ``` |
| 61 | //! ```ignore | ||
| 62 | //! embassy_time::time_driver_impl!(static DRIVER: MyDriver = MyDriver{}); | ||
| 63 | //! ``` | ||
| 62 | 64 | ||
| 63 | /// Alarm handle, assigned by the driver. | 65 | /// Alarm handle, assigned by the driver. |
| 64 | #[derive(Clone, Copy)] | 66 | #[derive(Clone, Copy)] |
diff --git a/embassy-time/src/queue.rs b/embassy-time/src/queue.rs index c6f8b440a..d65197c54 100644 --- a/embassy-time/src/queue.rs +++ b/embassy-time/src/queue.rs | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | //! use embassy_time::queue::{TimerQueue}; | 23 | //! use embassy_time::queue::{TimerQueue}; |
| 24 | //! | 24 | //! |
| 25 | //! struct MyTimerQueue{}; // not public! | 25 | //! struct MyTimerQueue{}; // not public! |
| 26 | //! embassy_time::timer_queue_impl!(static QUEUE: MyTimerQueue = MyTimerQueue{}); | ||
| 27 | //! | 26 | //! |
| 28 | //! impl TimerQueue for MyTimerQueue { | 27 | //! impl TimerQueue for MyTimerQueue { |
| 29 | //! fn schedule_wake(&'static self, at: Instant, waker: &Waker) { | 28 | //! fn schedule_wake(&'static self, at: Instant, waker: &Waker) { |
| @@ -31,6 +30,9 @@ | |||
| 31 | //! } | 30 | //! } |
| 32 | //! } | 31 | //! } |
| 33 | //! ``` | 32 | //! ``` |
| 33 | //! ```ignore | ||
| 34 | //! embassy_time::timer_queue_impl!(static QUEUE: MyTimerQueue = MyTimerQueue{}); | ||
| 35 | //! ``` | ||
| 34 | use core::task::Waker; | 36 | use core::task::Waker; |
| 35 | 37 | ||
| 36 | use crate::Instant; | 38 | use crate::Instant; |
