Skip to content

Commit f726eb0

Browse files
authored
Merge pull request #289 from jessebraham/feature/cfg-symbols
Add cfg symbols for `i2s` and `mcpwm`
2 parents 4ab05e8 + 91f18c8 commit f726eb0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

esp-hal-common/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ fn main() {
2424
// - 'dac'
2525
// - 'gdma'
2626
// - 'i2c1'
27+
// - 'i2s'
28+
// - 'mcpwm'
2729
// - 'pdma'
2830
// - 'rmt'
2931
// - 'spi3'
@@ -39,9 +41,11 @@ fn main() {
3941
vec![
4042
"esp32",
4143
"xtensa",
44+
"mcpwm",
4245
"multi_core",
4346
"dac",
4447
"i2c1",
48+
"i2s",
4549
"pdma",
4650
"rmt",
4751
"spi3",
@@ -56,6 +60,7 @@ fn main() {
5660
"riscv",
5761
"single_core",
5862
"gdma",
63+
"i2s",
5964
"rmt",
6065
"spi3",
6166
"systimer",
@@ -69,6 +74,7 @@ fn main() {
6974
"single_core",
7075
"dac",
7176
"i2c1",
77+
"i2s",
7278
"pdma",
7379
"rmt",
7480
"spi3",
@@ -83,6 +89,8 @@ fn main() {
8389
"multi_core",
8490
"gdma",
8591
"i2c1",
92+
"i2s",
93+
"mcpwm",
8694
"rmt",
8795
"spi3",
8896
"systimer",

esp-hal-common/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub use self::{
4848
timer::Timer,
4949
};
5050

51-
pub mod sha;
5251
pub mod analog;
5352
pub mod clock;
5453
pub mod delay;
@@ -57,12 +56,10 @@ pub mod dma;
5756
pub mod embassy;
5857
pub mod gpio;
5958
pub mod i2c;
60-
61-
#[cfg(any(esp32c3, esp32s3, esp32, esp32s2))]
59+
#[cfg(i2s)]
6260
pub mod i2s;
63-
6461
pub mod ledc;
65-
#[cfg(any(esp32, esp32s3))]
62+
#[cfg(mcpwm)]
6663
pub mod mcpwm;
6764
#[cfg(usb_otg)]
6865
pub mod otg_fs;
@@ -73,6 +70,7 @@ pub mod rng;
7370
pub mod rom;
7471
pub mod rtc_cntl;
7572
pub mod serial;
73+
pub mod sha;
7674
pub mod spi;
7775
pub mod system;
7876
#[cfg(systimer)]

0 commit comments

Comments
 (0)