Skip to content

Commit

Permalink
Patch embassy for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Nov 6, 2023
1 parent 95f24bd commit 12aa3ba
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 17 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ jobs:
with:
target: riscv32imc-unknown-none-elf
toolchain: "1.67"
components: rust-src
components: rust-src
- uses: Swatinem/rust-cache@v2

# build the ulp-riscv-hal examples first to make sure the examples which expect
Expand Down Expand Up @@ -638,25 +638,26 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
with:
target: riscv32imc-unknown-none-elf, riscv32imac-unknown-none-elf
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@v2

# Run clippy on all packages targeting RISC-V.
- name: clippy (esp-riscv-rt)
run: cargo +stable clippy --manifest-path=esp-riscv-rt/Cargo.toml -- -D warnings
run: cd esp-riscv-rt && cargo +stable clippy -- -D warnings
- name: clippy (esp32c2-hal)
run: cargo +stable clippy --manifest-path=esp32c2-hal/Cargo.toml -- -D warnings
run: cd esp32c2-hal && cargo +stable clippy -- -D warnings
- name: clippy (esp32c3-hal)
run: cargo +stable clippy --manifest-path=esp32c3-hal/Cargo.toml -- -D warnings
run: cd esp32c3-hal && cargo +stable clippy -- -D warnings
- name: clippy (esp32c6-hal)
run: cargo +stable clippy --manifest-path=esp32c6-hal/Cargo.toml -- -D warnings
run: cd esp32c6-hal && cargo +stable clippy -- -D warnings
- name: clippy (esp32c6-lp-hal)
run: cargo +stable clippy --manifest-path=esp32c6-lp-hal/Cargo.toml -- -D warnings -A asm-sub-register
run: cd esp32c6-lp-hal && cargo +stable clippy -- -D warnings -A asm-sub-register
- name: clippy (esp32h2-hal)
run: cargo +stable clippy --manifest-path=esp32h2-hal/Cargo.toml -- -D warnings
run: cd esp32h2-hal && cargo +stable clippy -- -D warnings
- name: clippy (ulp-riscv-hal)
run: cargo +stable clippy --manifest-path=ulp-riscv-hal/Cargo.toml --features=esp32s3 -- -D warnings -A asm-sub-register
run: cd ulp-riscv-hal && cargo +stable clippy --features=esp32s3 -- -D warnings -A asm-sub-register

clippy-xtensa:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions esp-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ pub mod trapframe {
// be directly exposed.
mod soc;

#[allow(unused)]
#[cfg(any(has_native_atomic_support, feature = "atomic-emulation"))]
use core::sync::atomic;

#[allow(unused)]
#[cfg(feature = "portable-atomic")]
use portable_atomic as atomic;

Expand Down
15 changes: 11 additions & 4 deletions esp32c2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ categories = [
]

[dependencies]
esp-hal-common = { version = "0.13.0", features = ["esp32c2"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.5", features = ["nightly"], optional = true }
esp-hal-common = { version = "0.13.0", features = ["esp32c2"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.5", features = ["nightly"], optional = true }
portable-atomic = { version = "1.5.1", features = ["unsafe-assume-single-core"], optional = true }

[dev-dependencies]
critical-section = "1.1.2"
Expand All @@ -47,7 +48,7 @@ crypto-bigint = {version = "0.5.3", default-features = false }
elliptic-curve = {version = "0.13.6", default-features = false, features = ["sec1"] }
p192 = {version = "0.13.0", default-features = false, features = ["arithmetic"] }
p256 = {version = "0.13.2", default-features = false, features = ["arithmetic"] }
embassy-sync = "0.3.0"
embassy-sync = "0.4.0"

[features]
default = ["rt", "vectored", "xtal-40mhz", "portable-atomic"]
Expand All @@ -70,7 +71,7 @@ embassy = ["esp-hal-common/embassy"]
embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-16_000_000"]
embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"]

portable-atomic = ["esp-hal-common/portable-atomic"]
portable-atomic = ["esp-hal-common/portable-atomic", "dep:portable-atomic"]
atomic-emulation = ["esp-hal-common/riscv-atomic-emulation"]

[profile.release]
Expand Down Expand Up @@ -111,3 +112,9 @@ required-features = ["embassy", "async"]
[[example]]
name = "direct-vectoring"
required-features = ["direct-vectoring"]

[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-time = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git" }
17 changes: 12 additions & 5 deletions esp32c3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ categories = [
]

[dependencies]
cfg-if = "1.0.0"
esp-hal-common = { version = "0.13.0", features = ["esp32c3"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.5", features = ["nightly"], optional = true }
cfg-if = "1.0.0"
esp-hal-common = { version = "0.13.0", features = ["esp32c3"], path = "../esp-hal-common" }
embassy-time = { version = "0.1.5", features = ["nightly"], optional = true }
portable-atomic = { version = "1.5.1", features = ["unsafe-assume-single-core"], optional = true }

[dev-dependencies]
aes = "0.8.3"
Expand All @@ -50,7 +51,7 @@ sha2 = { version = "0.10.8", default-features = false }
smart-leds = "0.3.0"
ssd1306 = "0.8.4"
static_cell = { version = "2.0.0", features = ["nightly"] }
embassy-sync = "0.3.0"
embassy-sync = "0.4.0"

[features]
default = ["rt", "vectored", "esp-hal-common/rv-zero-rtc-bss", "portable-atomic"]
Expand All @@ -72,7 +73,7 @@ embassy = ["esp-hal-common/embassy"]
embassy-time-systick = ["esp-hal-common/embassy-time-systick", "embassy-time/tick-hz-16_000_000"]
embassy-time-timg0 = ["esp-hal-common/embassy-time-timg0", "embassy-time/tick-hz-1_000_000"]

portable-atomic = ["esp-hal-common/portable-atomic"]
portable-atomic = ["esp-hal-common/portable-atomic", "dep:portable-atomic"]
atomic-emulation = ["esp-hal-common/riscv-atomic-emulation"]

[profile.release]
Expand Down Expand Up @@ -129,3 +130,9 @@ required-features = ["embassy", "async"]
[[example]]
name = "direct-vectoring"
required-features = ["direct-vectoring"]

[patch.crates-io]
embassy-executor = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-time = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-sync = { git = "https://github.com/embassy-rs/embassy.git" }
embassy-futures = { git = "https://github.com/embassy-rs/embassy.git" }

0 comments on commit 12aa3ba

Please sign in to comment.