Skip to content

Commit

Permalink
🔧 update features and targets
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 18, 2024
1 parent 1efd37d commit 880831b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
13 changes: 12 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ resolver = "2"

[lib]


[profile.release]
opt-level = "s"

Expand All @@ -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 = []
esp32s3 = []

pio = ["esp-idf-svc/pio"]
std = ["alloc", "esp-idf-svc/binstart", "esp-idf-svc/std"]
Expand Down
16 changes: 8 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit 880831b

Please sign in to comment.