aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/Cargo.toml
blob: 79680ae746a4e368ec9c2d297a3b1220dfdd7991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[package]
name = "embassy-executor"
version = "0.9.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "async/await executor designed for embedded usage"
repository = "https://github.com/embassy-rs/embassy"
documentation = "https://docs.embassy.dev/embassy-executor"
categories = [
    "embedded",
    "no-std",
    "asynchronous",
]

[package.metadata.embassy]
build = [
    {target = "thumbv7em-none-eabi", features = []},
    {target = "thumbv7em-none-eabi", features = ["log"]},
    {target = "thumbv7em-none-eabi", features = ["defmt"]},
    {target = "thumbv6m-none-eabi", features = ["defmt"]},
    {target = "thumbv6m-none-eabi", features = ["arch-cortex-m", "defmt", "executor-interrupt", "executor-thread"]},
    {target = "thumbv7em-none-eabi", features = ["arch-cortex-m"]},
    {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "rtos-trace"]},
    {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-thread"]},
    {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt"]},
    {target = "thumbv7em-none-eabi", features = ["arch-cortex-m", "executor-interrupt", "executor-thread"]},
    {target = "armv7a-none-eabi", features = ["arch-cortex-ar", "executor-thread"]},
    {target = "armv7r-none-eabi", features = ["arch-cortex-ar", "executor-thread"]},
    {target = "armv7r-none-eabihf", features = ["arch-cortex-ar", "executor-thread"]},
    {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32"]},
    {target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread"]},
]


[package.metadata.embassy_docs]
src_base = "https://github.com/embassy-rs/embassy/blob/embassy-executor-v$VERSION/embassy-executor/src/"
src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-executor/src/"
features = ["defmt"]
flavors = [
    { name = "std",             target = "x86_64-unknown-linux-gnu",     features = ["arch-std", "executor-thread"] },
    { name = "wasm",            target = "wasm32-unknown-unknown",       features = ["arch-wasm", "executor-thread"] },
    { name = "cortex-m",        target = "thumbv7em-none-eabi",          features = ["arch-cortex-m", "executor-thread", "executor-interrupt"] },
    { name = "riscv32",         target = "riscv32imac-unknown-none-elf", features = ["arch-riscv32", "executor-thread"] },
]

[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabi"
targets = ["thumbv7em-none-eabi"]
features = ["defmt", "arch-cortex-m", "executor-thread", "executor-interrupt"]

[dependencies]
defmt = { version = "1.0.1", optional = true }
log = { version = "0.4.14", optional = true }
rtos-trace = { version = "0.1.3", optional = true }

embassy-executor-macros = { version = "0.7.0", path = "../embassy-executor-macros" }
embassy-time-driver = { version = "0.2.1", path = "../embassy-time-driver", optional = true }
embassy-executor-timer-queue = { version = "0.1", path = "../embassy-executor-timer-queue" }
critical-section = "1.1"

document-features = "0.2.7"

# needed for AVR
portable-atomic = { version = "1.5", optional = true }

# arch-cortex-m dependencies
cortex-m = { version = "0.7.6", optional = true }

# arch-cortex-ar dependencies
cortex-ar = { version = "0.2", optional = true }

# arch-wasm dependencies
wasm-bindgen = { version = "0.2.82", optional = true }
js-sys = { version = "0.3", optional = true }

# arch-avr dependencies
avr-device = { version = "0.7.0", optional = true }

[dev-dependencies]
critical-section = { version = "1.1", features = ["std"] }
trybuild = "1.0"
embassy-sync = { path = "../embassy-sync" }
rustversion = "1.0.21"

[features]

## Enable nightly-only features
nightly = ["embassy-executor-macros/nightly"]

# Enables turbo wakers, which requires patching core. Not surfaced in the docs by default due to
# being an complicated advanced and undocumented feature.
# See: https://github.com/embassy-rs/embassy/pull/1263
turbowakers = []

#! ### Architecture
_arch = [] # some arch was picked
## std
arch-std = ["_arch"]
## Cortex-M
arch-cortex-m = ["_arch", "dep:cortex-m"]
## Cortex-A/R
arch-cortex-ar = ["_arch", "dep:cortex-ar"]
## RISC-V 32
arch-riscv32 = ["_arch"]
## WASM
arch-wasm = ["_arch", "dep:wasm-bindgen", "dep:js-sys"]
## AVR
arch-avr = ["_arch", "dep:portable-atomic", "dep:avr-device"]
## spin (architecture agnostic; never sleeps)
arch-spin = ["_arch"]

#! ### Metadata

## Enable the `name` field in task metadata.
metadata-name = []

#! ### Executor

## Enable the thread-mode executor (using WFE/SEV in Cortex-M, WFI in other embedded archs)
executor-thread = []
## Enable the interrupt-mode executor (available in Cortex-M only)
executor-interrupt = []
## Enable tracing hooks
trace = ["_any_trace"]
## Enable support for rtos-trace framework
rtos-trace = ["_any_trace", "metadata-name", "dep:rtos-trace", "dep:embassy-time-driver"]
_any_trace = []

#! ### Timer Item Payload Size
#! Sets the size of the payload for timer items, allowing integrated timer implementors to store
#! additional data in the timer item. The payload field will be aligned to this value as well.
#! If these features are not defined, the timer item will contain no payload field.

_timer-item-payload = [] # A size was picked

## 1 bytes
timer-item-payload-size-1 = ["_timer-item-payload"]
## 2 bytes
timer-item-payload-size-2 = ["_timer-item-payload"]
## 4 bytes
timer-item-payload-size-4 = ["_timer-item-payload"]
## 8 bytes
timer-item-payload-size-8 = ["_timer-item-payload"]