From c8afe5c74ab412b488e835dbdd9fc5f3cf5a71eb Mon Sep 17 00:00:00 2001 From: Christian M Date: Sun, 18 Feb 2024 19:07:23 +0100 Subject: [PATCH] :wrench: update features and targets --- .cargo/config.toml | 13 ++++++++++++- Cargo.toml | 7 +++---- src/main.rs | 16 ++++++++-------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 254738c..2ed1f42 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,12 +6,23 @@ target = "xtensa-esp32-espidf" linker = "ldproxy" # runner = "espflash --monitor" # Select this runner for espflash v1.x.x runner = "espflash flash --monitor" # Select this runner for espflash v2.x.x -rustflags = ["--cfg", "mio_unsupported_force_poll_poll", "--cfg", "espidf_time64", "-C", "default-linker-libraries"] +rustflags = [ + "--cfg", + "esp32", + "--cfg", + "mio_unsupported_force_poll_poll", + "--cfg", + "espidf_time64", + "-C", + "default-linker-libraries", +] [target.xtensa-esp32s3-espidf] linker = "ldproxy" runner = "espflash flash --monitor" rustflags = [ + "--cfg", + "esp32s3", "--cfg", "mio_unsupported_force_poll_poll", "--cfg", diff --git a/Cargo.toml b/Cargo.toml index a79420d..53189a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ resolver = "2" [lib] - [profile.release] opt-level = "s" @@ -16,9 +15,9 @@ debug = true # Symbols are nice and they don't increase the size on Flash opt-level = "z" [features] -default = ["std", "embassy", "esp-idf-svc/native", "v2"] -v2 = [] -v3 = [] +default = ["std", "embassy", "esp-idf-svc/native", "esp32"] +esp32 = [] +esp32s3 = [] pio = ["esp-idf-svc/pio"] std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"] diff --git a/src/main.rs b/src/main.rs index c806cab..dae0c6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,24 +20,24 @@ fn main() -> anyhow::Result<()> { modem, pins, i2c0, .. } = peripherals; - #[cfg(feature = "v2")] + #[cfg(feature = "esp32")] let mut led = PinDriver::output(pins.gpio25)?; - #[cfg(feature = "v3")] + #[cfg(feature = "esp32s3")] let mut led = PinDriver::output(pins.gpio35)?; - #[cfg(feature = "v2")] + #[cfg(feature = "esp32")] let rst = pins.gpio16; - #[cfg(feature = "v3")] + #[cfg(feature = "esp32s3")] let rst = pins.gpio21; - #[cfg(feature = "v2")] + #[cfg(feature = "esp32")] let sda = pins.gpio4; - #[cfg(feature = "v3")] + #[cfg(feature = "esp32s3")] let sda = pins.gpio17; - #[cfg(feature = "v2")] + #[cfg(feature = "esp32")] let scl = pins.gpio15; - #[cfg(feature = "v3")] + #[cfg(feature = "esp32s3")] let scl = pins.gpio18; let mut display = Display::new(i2c0, rst, sda, scl)?;