Skip to content

Commit

Permalink
feat: Remove log feature
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Mar 20, 2024
1 parent ed0f57a commit 57e058b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion hil-test/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runner = "probe-rs run"
rustflags = [
"-C", "link-arg=-Tlinkall.x",
"-C", "link-arg=-Tembedded-test.x",
"-C", "link-arg=-Tdefmt.x", # Comment this line when using log feature
"-C", "link-arg=-Tdefmt.x",
]

[target.'cfg(target_arch = "xtensa")']
Expand Down
16 changes: 4 additions & 12 deletions hil-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@ name = "uart"
harness = false

[dependencies]
defmt = { version = "0.3.5", optional = true }
defmt-rtt = { version = "0.4.0", optional = true }
log = { version = "0.4.20", optional = true }
esp-hal = { path = "../esp-hal", features = ["eh1"], optional = true }
defmt = { version = "0.3.5" }
defmt-rtt = { version = "0.4.0" }
esp-hal = { path = "../esp-hal", features = ["eh1", "defmt"], optional = true }
embedded-hal = { version = "0.2.7", features = ["unproven"] }
embedded-hal-async = { version = "1.0.0", optional = true }
embedded-hal-1 = { version = "1.0.0", package = "embedded-hal" }
embassy-executor = { default-features = false, version = "0.5.0", features = ["executor-thread", "arch-riscv32"], optional = true }
semihosting = "0.1.6"

[dev-dependencies]
# Add the `embedded-test/defmt` feature for more verbose testing
embedded-test = {git = "https://github.com/probe-rs/embedded-test/", branch = "next"}

[features]
default = ["defmt"]
# Device support (required!):
esp32 = ["esp-hal/esp32"]
esp32c2 = ["esp-hal/esp32c2"]
Expand All @@ -52,13 +51,6 @@ embassy-executor-thread = ["esp-hal?/embassy-executor-thread"]
embassy-time-systick-16mhz = ["esp-hal?/embassy-time-systick-16mhz"]
embassy-time-systick-80mhz = ["esp-hal?/embassy-time-systick-80mhz"]
embassy-time-timg0 = ["esp-hal?/embassy-time-timg0"]
# Loggging:
# Adding log feature of embedded test to defmt or log makes the testing more verbose
# log = ["dep:log", "embedded-test/log", "embedded-test/init-log"]
# defmt = ["dep:defmt", "dep:defmt-rtt", "embedded-test/defmt"]
log = ["dep:log", "embedded-test/init-log", "esp-hal?/log"]
# Using defmt crate requires editting `.cargo/config.toml`rustflags.
defmt = ["dep:defmt", "dep:defmt-rtt", "esp-hal?/defmt"]

# cargo build/run
[profile.dev]
Expand Down
2 changes: 0 additions & 2 deletions hil-test/tests/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![no_std]
#![no_main]

#[cfg(feature = "defmt")]
use defmt_rtt as _;
use esp_hal::{
aes::{Aes, Mode},
Expand Down Expand Up @@ -39,7 +38,6 @@ mod not_test {
#[cfg(any(esp32c3, esp32c6, esp32h2))]
#[embedded_test::tests]
mod tests {
#[cfg(feature = "defmt")]
use defmt::assert_eq;

use super::*;
Expand Down
2 changes: 0 additions & 2 deletions hil-test/tests/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![no_std]
#![no_main]

#[cfg(feature = "defmt")]
use defmt_rtt as _;
use embedded_hal_1::digital::{InputPin as _, OutputPin as _, StatefulOutputPin as _};
use esp_hal::{
Expand Down Expand Up @@ -35,7 +34,6 @@ impl Context {
#[cfg(test)]
#[embedded_test::tests]
mod tests {
#[cfg(feature = "defmt")]
use defmt::assert_eq;

use super::*;
Expand Down
2 changes: 0 additions & 2 deletions hil-test/tests/spi_full_duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#![no_std]
#![no_main]

#[cfg(feature = "defmt")]
use defmt_rtt as _;
use esp_hal::{
clock::ClockControl,
Expand Down Expand Up @@ -51,7 +50,6 @@ impl Context {
#[cfg(test)]
#[embedded_test::tests]
mod tests {
#[cfg(feature = "defmt")]
use defmt::assert_eq;

use super::*;
Expand Down
2 changes: 0 additions & 2 deletions hil-test/tests/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#![no_std]
#![no_main]

#[cfg(feature = "defmt")]
use defmt_rtt as _;
use esp_hal::{
clock::ClockControl,
Expand Down Expand Up @@ -53,7 +52,6 @@ impl Context {
#[cfg(test)]
#[embedded_test::tests]
mod tests {
#[cfg(feature = "defmt")]
use defmt::assert_eq;

use super::*;
Expand Down

0 comments on commit 57e058b

Please sign in to comment.