diff options
| -rw-r--r-- | embassy-time/src/driver.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/embassy-time/src/driver.rs b/embassy-time/src/driver.rs index 81ee1b0f5..2afa454fe 100644 --- a/embassy-time/src/driver.rs +++ b/embassy-time/src/driver.rs | |||
| @@ -7,11 +7,16 @@ | |||
| 7 | //! - Define a struct `MyDriver` | 7 | //! - Define a struct `MyDriver` |
| 8 | //! - Implement [`Driver`] for it | 8 | //! - Implement [`Driver`] for it |
| 9 | //! - Register it as the global driver with [`time_driver_impl`](crate::time_driver_impl). | 9 | //! - Register it as the global driver with [`time_driver_impl`](crate::time_driver_impl). |
| 10 | //! - Enable the Cargo features `embassy-executor/time` and one of `embassy-time/tick-*` corresponding to the | 10 | //! - Enable the Cargo feature `embassy-executor/time` |
| 11 | //! tick rate of your driver. | ||
| 12 | //! | 11 | //! |
| 13 | //! If you wish to make the tick rate configurable by the end user, you should do so by exposing your own | 12 | //! If your driver has a single set tick rate, enable the corresponding [`tick-hz-*`](crate#tick-rate) feature, |
| 14 | //! Cargo features and having each enable the corresponding `embassy-time/tick-*`. | 13 | //! which will prevent users from needing to configure it themselves (or selecting an incorrect configuration). |
| 14 | //! | ||
| 15 | //! If your driver supports a small number of set tick rates, expose your own cargo features and have each one | ||
| 16 | //! enable the corresponding `embassy-time/tick-*`. | ||
| 17 | //! | ||
| 18 | //! Otherwise, don’t enable any `tick-hz-*` feature to let the user configure the tick rate themselves by | ||
| 19 | //! enabling a feature on `embassy-time`. | ||
| 15 | //! | 20 | //! |
| 16 | //! # Linkage details | 21 | //! # Linkage details |
| 17 | //! | 22 | //! |
