Skip to content

Commit

Permalink
feat: introduce executor-none
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Jun 18, 2024
1 parent f60aae1 commit fdcedc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
14 changes: 11 additions & 3 deletions src/riot-rs-embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ esp-wifi = { workspace = true, features = [

[target.'cfg(context = "esp32c3")'.dependencies]
esp-hal = { workspace = true, features = ["esp32c3"] }
esp-hal-embassy = { workspace = true, default-features = false, features = ["esp32c3"] }
esp-hal-embassy = { workspace = true, default-features = false, features = [
"esp32c3",
] }
esp-wifi = { workspace = true, features = ["esp32c3"], optional = true }

[target.'cfg(context = "esp32c6")'.dependencies]
esp-hal = { workspace = true, features = ["esp32c6"] }
esp-hal-embassy = { workspace = true, default-features = false, features = ["esp32c6"] }
esp-hal-embassy = { workspace = true, default-features = false, features = [
"esp32c6",
] }
esp-wifi = { workspace = true, features = ["esp32c6"], optional = true }

[features]
Expand All @@ -118,6 +122,10 @@ threading = ["dep:riot-rs-threads"]
override-network-config = []
override-usb-config = []

executor-single-thread = ["riot-rs-rt/executor-single-thread", "esp-hal-embassy?/executors"]
executor-single-thread = [
"riot-rs-rt/executor-single-thread",
"esp-hal-embassy?/executors",
]
executor-interrupt = ["embassy-executor/executor-interrupt"]
executor-thread = ["threading"]
executor-none = []
3 changes: 2 additions & 1 deletion src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ pub static EMBASSY_TASKS: [Task] = [..];

#[cfg(not(any(
feature = "executor-interrupt",
feature = "executor-none",
feature = "executor-single-thread",
feature = "executor-thread"
)))]
compile_error!(
"must select one of \"executor-interrupt\", \"executor-single-thread\", \"executor-thread\"!"
"must select one of \"executor-interrupt\", \"executor-single-thread\", \"executor-thread\", \"executor-none\"!"
);

#[cfg(all(feature = "threading", feature = "executor-single-thread"))]
Expand Down
4 changes: 3 additions & 1 deletion src/riot-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bench = ["dep:riot-rs-bench"]
## Prints nothing in case of panics (may help reduce binary size).
silent-panic = ["riot-rs-rt/silent-panic"]
## Allows to have no boards selected, useful to run target-independent tooling.
no-boards = ["riot-rs-boards/no-boards"]
no-boards = ["riot-rs-boards/no-boards", "executor-none"]

net = ["riot-rs-embassy/net"]

Expand All @@ -87,3 +87,5 @@ executor-interrupt = ["riot-rs-embassy/executor-interrupt"]
executor-single-thread = ["riot-rs-embassy/executor-single-thread"]
## Use executor inside a riot-rs-threading thread
executor-thread = ["riot-rs-embassy/executor-thread", "threading"]
## Don't start any executor automatically. (used for compile testing only)
executor-none = ["riot-rs-embassy/executor-none"]

0 comments on commit fdcedc8

Please sign in to comment.