Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit c72d7a2

Browse files
authored
Merge pull request #11 from jessebraham/feature/esp32c2
Add support for the ESP32-C2 (aka ESP8684)
2 parents f89e175 + faaceb9 commit c72d7a2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ repository = "https://github.com/esp-rs/esp-println"
1111
license = "MIT OR Apache-2.0"
1212

1313
[dependencies]
14-
log = { version = "0.4.17", optional = true }
14+
log = { version = "0.4.17", optional = true }
1515

1616
[features]
1717
default = ["uart"]
1818

1919
# You must enable exactly 1 of the below features to support the correct chip:
2020
esp32 = []
21+
esp32c2 = []
2122
esp32c3 = []
2223
esp32s2 = []
2324
esp32s3 = []

build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fn main() {
22
// Ensure that only a single chip is specified
33
let chip_features = [
44
cfg!(feature = "esp32"),
5+
cfg!(feature = "esp32c2"),
56
cfg!(feature = "esp32c3"),
67
cfg!(feature = "esp32s2"),
78
cfg!(feature = "esp32s3"),
@@ -29,9 +30,7 @@ fn main() {
2930

3031
// Ensure that, if the `jtag_serial` communication method feature is
3132
// enabled, either the `esp32c3` or `esp32s3` chip feature is enabled.
32-
if cfg!(feature = "jtag_serial")
33-
&& (cfg!(feature = "esp32") || cfg!(feature = "esp32s2") || cfg!(feature = "esp8266"))
34-
{
33+
if cfg!(feature = "jtag_serial") && !(cfg!(feature = "esp32c3") || cfg!(feature = "esp32s3")) {
3534
panic!("The `jtag_serial` feature is only supported by the ESP32-C3 and ESP32-S3");
3635
}
3736
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![no_std]
2-
#![allow(dead_code)]
32

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

2726
#[cfg(feature = "esp32")]
2827
const UART_TX_ONE_CHAR: usize = 0x40009200;
28+
#[cfg(feature = "esp32c2")]
29+
const UART_TX_ONE_CHAR: usize = 0x40000058;
2930
#[cfg(feature = "esp32c3")]
3031
const UART_TX_ONE_CHAR: usize = 0x40000068;
3132
#[cfg(feature = "esp32s3")]

0 commit comments

Comments
 (0)