diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-04-03 01:18:27 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-04-03 03:09:11 +0200 |
| commit | d3c4e4a20a05085eae8d568c7efdbe09bada9cf5 (patch) | |
| tree | ef92420c5a4574c9db5cb614d0ecc49d6462badc /embassy-executor/Cargo.toml | |
| parent | b41ee47115509ba5ed302c684c0c36b6a3e3f76f (diff) | |
executor: add Pender, rework Cargo features.
This introduces a `Pender` struct with enum cases for thread-mode, interrupt-mode and
custom callback executors. This avoids calls through function pointers when using only
the thread or interrupt executors. Faster, and friendlier to `cargo-call-stack`.
`embassy-executor` now has `arch-xxx` Cargo features to select the arch and to enable
the builtin executors (thread and interrupt).
Diffstat (limited to 'embassy-executor/Cargo.toml')
| -rw-r--r-- | embassy-executor/Cargo.toml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/embassy-executor/Cargo.toml b/embassy-executor/Cargo.toml index 8ad3fd698..bb8a46c82 100644 --- a/embassy-executor/Cargo.toml +++ b/embassy-executor/Cargo.toml | |||
| @@ -31,9 +31,22 @@ flavors = [ | |||
| 31 | features = ["std", "nightly", "defmt"] | 31 | features = ["std", "nightly", "defmt"] |
| 32 | 32 | ||
| 33 | [features] | 33 | [features] |
| 34 | default = [] | 34 | |
| 35 | std = ["critical-section/std"] | 35 | # Architecture |
| 36 | wasm = ["dep:wasm-bindgen", "dep:js-sys"] | 36 | _arch = [] # some arch was picked |
| 37 | arch-std = ["_arch", "critical-section/std"] | ||
| 38 | arch-cortex-m = ["_arch", "dep:cortex-m"] | ||
| 39 | arch-xtensa = ["_arch"] | ||
| 40 | arch-riscv32 = ["_arch"] | ||
| 41 | arch-wasm = ["_arch", "dep:wasm-bindgen", "dep:js-sys"] | ||
| 42 | |||
| 43 | # Enable creating a `Pender` from an arbitrary function pointer callback. | ||
| 44 | pender-callback = [] | ||
| 45 | |||
| 46 | # Enable the thread-mode executor (using WFE/SEV in Cortex-M, WFI in other embedded archs) | ||
| 47 | executor-thread = [] | ||
| 48 | # Enable the interrupt-mode executor (available in Cortex-M only) | ||
| 49 | executor-interrupt = [] | ||
| 37 | 50 | ||
| 38 | # Enable nightly-only features | 51 | # Enable nightly-only features |
| 39 | nightly = [] | 52 | nightly = [] |
| @@ -55,9 +68,11 @@ embassy-macros = { version = "0.1.0", path = "../embassy-macros" } | |||
| 55 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true} | 68 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true} |
| 56 | atomic-polyfill = "1.0.1" | 69 | atomic-polyfill = "1.0.1" |
| 57 | critical-section = "1.1" | 70 | critical-section = "1.1" |
| 58 | cfg-if = "1.0.0" | ||
| 59 | static_cell = "1.0" | 71 | static_cell = "1.0" |
| 60 | 72 | ||
| 61 | # WASM dependencies | 73 | # arch-cortex-m dependencies |
| 74 | cortex-m = { version = "0.7.6", optional = true } | ||
| 75 | |||
| 76 | # arch-wasm dependencies | ||
| 62 | wasm-bindgen = { version = "0.2.82", optional = true } | 77 | wasm-bindgen = { version = "0.2.82", optional = true } |
| 63 | js-sys = { version = "0.3", optional = true } | 78 | js-sys = { version = "0.3", optional = true } |
