diff options
| author | Dániel Buga <[email protected]> | 2023-08-14 08:32:26 +0200 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2023-08-14 08:32:26 +0200 |
| commit | 454a7cbf4c0eb3a4e651e7da5512ec49ff7d4050 (patch) | |
| tree | e66c4c70dfb8b7e2ad591d2889b91d6c36907c97 /embassy-executor/src/raw/mod.rs | |
| parent | ec6bd27df6101bc5f77fa4eace0e8963970231ad (diff) | |
Remove pender-callback
Diffstat (limited to 'embassy-executor/src/raw/mod.rs')
| -rw-r--r-- | embassy-executor/src/raw/mod.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs index 7795f1e4a..81ad1e53d 100644 --- a/embassy-executor/src/raw/mod.rs +++ b/embassy-executor/src/raw/mod.rs | |||
| @@ -317,29 +317,12 @@ pub enum Pender { | |||
| 317 | /// Pender for an interrupt-mode executor. | 317 | /// Pender for an interrupt-mode executor. |
| 318 | #[cfg(feature = "executor-interrupt")] | 318 | #[cfg(feature = "executor-interrupt")] |
| 319 | Interrupt(OpaqueInterruptContext), | 319 | Interrupt(OpaqueInterruptContext), |
| 320 | |||
| 321 | /// Arbitrary, dynamically dispatched pender. | ||
| 322 | #[cfg(feature = "pender-callback")] | ||
| 323 | Callback { func: fn(*mut ()), context: *mut () }, | ||
| 324 | } | 320 | } |
| 325 | 321 | ||
| 326 | unsafe impl Send for Pender {} | 322 | unsafe impl Send for Pender {} |
| 327 | unsafe impl Sync for Pender {} | 323 | unsafe impl Sync for Pender {} |
| 328 | 324 | ||
| 329 | impl Pender { | 325 | impl Pender { |
| 330 | /// Create a `Pender` that will call an arbitrary function pointer. | ||
| 331 | /// | ||
| 332 | /// # Arguments | ||
| 333 | /// | ||
| 334 | /// - `func`: The function pointer to call. | ||
| 335 | /// - `context`: Opaque context pointer, that will be passed to the function pointer. | ||
| 336 | #[cfg(feature = "pender-callback")] | ||
| 337 | pub fn new_from_callback(func: fn(*mut ()), context: *mut ()) -> Self { | ||
| 338 | Self::Callback { func, context } | ||
| 339 | } | ||
| 340 | } | ||
| 341 | |||
| 342 | impl Pender { | ||
| 343 | pub(crate) fn pend(self) { | 326 | pub(crate) fn pend(self) { |
| 344 | match self { | 327 | match self { |
| 345 | #[cfg(feature = "executor-thread")] | 328 | #[cfg(feature = "executor-thread")] |
| @@ -356,8 +339,6 @@ impl Pender { | |||
| 356 | } | 339 | } |
| 357 | unsafe { __interrupt_mode_pender(interrupt) }; | 340 | unsafe { __interrupt_mode_pender(interrupt) }; |
| 358 | } | 341 | } |
| 359 | #[cfg(feature = "pender-callback")] | ||
| 360 | Pender::Callback { func, context } => func(context), | ||
| 361 | } | 342 | } |
| 362 | } | 343 | } |
| 363 | } | 344 | } |
