Skip to content

Commit

Permalink
Conditionally enable generic-queue feature
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 23, 2024
1 parent d610ee8 commit 2ad4324
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
9 changes: 6 additions & 3 deletions hil-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ defmt = "0.3.8"
defmt-rtt = { version = "0.4.1", optional = true }
embassy-futures = "0.1.1"
embassy-sync = "0.6.0"
embassy-time = { version = "0.3.1", features = ["generic-queue-64"] }
embassy-time = { version = "0.3.1" }
embedded-hal = "1.0.0"
embedded-hal-02 = { version = "0.2.7", package = "embedded-hal", features = ["unproven"] }
embedded-hal-async = { version = "1.0.0", optional = true }
Expand All @@ -166,7 +166,7 @@ digest = { version = "0.10.7", default-features = false }
elliptic-curve = { version = "0.13.8", default-features = false, features = ["sec1"] }
embassy-executor = { version = "0.6.0", default-features = false }
# Add the `embedded-test/defmt` feature for more verbose testing
embedded-test = { version = "0.4.0", default-features = false }
embedded-test = { version = "0.4.0", default-features = false, git = "https://github.com/probe-rs/embedded-test.git", branch = "embassy" }
fugit = "0.3.7"
hex-literal = "0.4.1"
nb = "1.1.0"
Expand Down Expand Up @@ -214,8 +214,11 @@ embassy = [
"embedded-test/external-executor",
"dep:esp-hal-embassy",
]
generic-queue = [
"embassy-time/generic-queue-64"
]
integrated-timers = [
"embassy-executor/integrated-timers",
"esp-hal-embassy/integrated-timers",
]

# https://doc.rust-lang.org/cargo/reference/profiles.html#test
Expand Down
26 changes: 15 additions & 11 deletions hil-test/tests/embassy_interrupt_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
#![no_main]

use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, signal::Signal};
use esp_hal::{
clock::ClockControl,
interrupt::Priority,
peripherals::Peripherals,
system::{SoftwareInterrupt, SystemControl},
timer::timg::TimerGroup,
};
use esp_hal_embassy::InterruptExecutor;
use hil_test as _;

macro_rules! mk_static {
($t:ty,$val:expr) => {{
Expand All @@ -26,24 +35,19 @@ async fn interrupt_driven_task(signal: &'static Signal<CriticalSectionRawMutex,
}

#[cfg(test)]
#[embedded_test::tests]
#[embedded_test::tests(executor = esp_hal_embassy::Executor::new())]
mod test {
use esp_hal::{
clock::ClockControl,
interrupt::Priority,
peripherals::Peripherals,
system::{SoftwareInterrupt, SystemControl},
};
use esp_hal_embassy::InterruptExecutor;
use hil_test as _;

use super::*;

#[init]
fn init() -> SoftwareInterrupt<1> {
let peripherals = Peripherals::take();
let system = SystemControl::new(peripherals.SYSTEM);
let _clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();

let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks);
esp_hal_embassy::init(&clocks, timg0.timer0);

system.software_interrupt_control.software_interrupt1
}

Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/embassy_timers_executors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Embassy timer and executor Test

//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: integrated-timers

#![no_std]
#![no_main]
Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/i2s_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! with loopback mode enabled). It's using circular DMA mode

//% CHIPS: esp32c3 esp32c6 esp32s3 esp32h2
//% FEATURES: generic-queue

#![no_std]
#![no_main]
Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/lcd_cam_i8080_async.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! lcd_cam i8080 tests

//% CHIPS: esp32s3
//% FEATURES: generic-queue

#![no_std]
#![no_main]
Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/spi_full_duplex_dma_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//! Connect PCNT (GPIO2) and MOSI (GPIO3) and MISO (GPIO6) and GPIO5 pins.

//% CHIPS: esp32 esp32c6 esp32h2 esp32s3
//% FEATURES: generic-queue

#![no_std]
#![no_main]
Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/uart_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! Connect TX (GPIO2) and RX (GPIO3) pins.

//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: generic-queue

#![no_std]
#![no_main]
Expand Down
1 change: 1 addition & 0 deletions hil-test/tests/uart_tx_rx_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! Connect TX (GPIO2) and RX (GPIO3) pins.

//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
//% FEATURES: generic-queue

#![no_std]
#![no_main]
Expand Down

0 comments on commit 2ad4324

Please sign in to comment.