Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ repository = "https://github.com/esp-rs/esp-println"
license = "MIT OR Apache-2.0"

[dependencies]
log = { version = "0.4.17", optional = true }
log = { version = "0.4.17", optional = true }

[features]
default = ["uart"]

# You must enable exactly 1 of the below features to support the correct chip:
esp32 = []
esp32c2 = []
esp32c3 = []
esp32s2 = []
esp32s3 = []
Expand Down
5 changes: 2 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ fn main() {
// Ensure that only a single chip is specified
let chip_features = [
cfg!(feature = "esp32"),
cfg!(feature = "esp32c2"),
cfg!(feature = "esp32c3"),
cfg!(feature = "esp32s2"),
cfg!(feature = "esp32s3"),
Expand Down Expand Up @@ -29,9 +30,7 @@ fn main() {

// Ensure that, if the `jtag_serial` communication method feature is
// enabled, either the `esp32c3` or `esp32s3` chip feature is enabled.
if cfg!(feature = "jtag_serial")
&& (cfg!(feature = "esp32") || cfg!(feature = "esp32s2") || cfg!(feature = "esp8266"))
{
if cfg!(feature = "jtag_serial") && !(cfg!(feature = "esp32c3") || cfg!(feature = "esp32s3")) {
panic!("The `jtag_serial` feature is only supported by the ESP32-C3 and ESP32-S3");
}
}
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![no_std]
#![allow(dead_code)]

#[macro_export]
macro_rules! println {
Expand All @@ -26,6 +25,8 @@ pub mod logger;

#[cfg(feature = "esp32")]
const UART_TX_ONE_CHAR: usize = 0x40009200;
#[cfg(feature = "esp32c2")]
const UART_TX_ONE_CHAR: usize = 0x40000058;
#[cfg(feature = "esp32c3")]
const UART_TX_ONE_CHAR: usize = 0x40000068;
#[cfg(feature = "esp32s3")]
Expand Down