Skip to content

Commit ac502ff

Browse files
committed
No longer hide BT, Thread and filesystems behind the experimental feature
1 parent ed819f5 commit ac502ff

5 files changed

Lines changed: 22 additions & 50 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Fix wrong BT configuration version on the c6 (issue #556)
2424
- Fix inconsistent mutability in NVS (#567)
2525
- Fix #570 (c_char vs i8 mismatch on newer rustc toolchains)
26+
- ESP-IDF partitions support is no longer behind the `experimental` feature
27+
- Filesystems support is no longer behind the `experimental` feature
28+
- Bluetooth support is no longer behind the `experimental` feature
29+
- Thread support is no longer behind the `experimental` feature
2630

2731
### Added
2832
- Logging configuration enhanced with a simpler setup where Rust logs can be configured to have a verbosity which is

examples/bt_ble_gap_scanner.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Example of a BLE GAP scanner using the ESP IDF Bluedroid BLE bindings.
2-
//! Build with `--features experimental` (for now).
32
//!
43
//! The example prints discovered ble devices on the console.
54
//!
@@ -22,21 +21,17 @@
2221
#![allow(unknown_lints)]
2322
#![allow(unexpected_cfgs)]
2423

25-
#[cfg(all(not(esp32s2), feature = "experimental"))]
24+
#[cfg(not(esp32s2))]
2625
fn main() -> anyhow::Result<()> {
2726
example::main()
2827
}
2928

30-
#[cfg(any(esp32s2, not(feature = "experimental")))]
29+
#[cfg(esp32s2)]
3130
fn main() -> anyhow::Result<()> {
32-
#[cfg(esp32s2)]
3331
panic!("ESP32-S2 does not have a BLE radio");
34-
35-
#[cfg(not(feature = "experimental"))]
36-
panic!("Use `--features experimental` when building this example");
3732
}
3833

39-
#[cfg(all(not(esp32s2), feature = "experimental"))]
34+
#[cfg(not(esp32s2))]
4035
mod example {
4136
use core::fmt;
4237
use core::hash::{Hash, Hasher};

examples/bt_gatt_server.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Example of a BLE GATT server using the ESP IDF Bluedroid BLE bindings.
2-
//! Build with `--features experimental` (for now).
32
//!
43
//! You can test it with any "GATT Browser" app, like e.g.
54
//! the "GATTBrowser" mobile app available on Android.
@@ -31,21 +30,17 @@
3130
#![allow(unknown_lints)]
3231
#![allow(unexpected_cfgs)]
3332

34-
#[cfg(all(not(esp32s2), feature = "experimental"))]
33+
#[cfg(not(esp32s2))]
3534
fn main() -> anyhow::Result<()> {
3635
example::main()
3736
}
3837

39-
#[cfg(any(esp32s2, not(feature = "experimental")))]
38+
#[cfg(esp32s2)]
4039
fn main() -> anyhow::Result<()> {
41-
#[cfg(esp32s2)]
4240
panic!("ESP32-S2 does not have a BLE radio");
43-
44-
#[cfg(not(feature = "experimental"))]
45-
panic!("Use `--features experimental` when building this example");
4641
}
4742

48-
#[cfg(all(not(esp32s2), feature = "experimental"))]
43+
#[cfg(not(esp32s2))]
4944
mod example {
5045
use std::sync::{Arc, Condvar, Mutex};
5146

src/io.rs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub mod vfs {
1515
#[cfg(esp_idf_soc_usb_serial_jtag_supported)]
1616
use crate::sys::{esp_vfs_usb_serial_jtag_use_driver, esp_vfs_usb_serial_jtag_use_nonblocking};
1717

18-
#[cfg(all(feature = "experimental", feature = "alloc"))]
18+
#[cfg(feature = "alloc")]
1919
extern crate alloc;
2020

2121
/// Represents a mounted EventFD pseudo-filesystem.
@@ -48,13 +48,13 @@ pub mod vfs {
4848
}
4949

5050
/// Represents a mounted SPIFFS filesystem.
51-
#[cfg(all(feature = "experimental", feature = "alloc"))]
51+
#[cfg(feature = "alloc")]
5252
pub struct MountedSpiffs<T> {
5353
_spiffs: T,
5454
path: alloc::ffi::CString,
5555
}
5656

57-
#[cfg(all(feature = "experimental", feature = "alloc"))]
57+
#[cfg(feature = "alloc")]
5858
impl<T> MountedSpiffs<T> {
5959
/// Mount a SPIFFS filesystem.
6060
///
@@ -84,23 +84,23 @@ pub mod vfs {
8484
}
8585
}
8686

87-
#[cfg(all(feature = "experimental", feature = "alloc"))]
87+
#[cfg(feature = "alloc")]
8888
impl<T> Drop for MountedSpiffs<T> {
8989
fn drop(&mut self) {
9090
sys::esp!(unsafe { sys::esp_vfs_spiffs_unregister(self.path.as_ptr()) }).unwrap();
9191
}
9292
}
9393

9494
/// Represents a mounted FAT filesystem.
95-
#[cfg(all(feature = "experimental", feature = "alloc"))]
95+
#[cfg(feature = "alloc")]
9696
pub struct MountedFatfs<T> {
9797
_handle: *mut sys::FATFS,
9898
_fatfs: T,
9999
path: alloc::ffi::CString,
100100
drive: u8,
101101
}
102102

103-
#[cfg(all(feature = "experimental", feature = "alloc"))]
103+
#[cfg(feature = "alloc")]
104104
impl<T> MountedFatfs<T> {
105105
/// Mount a FAT filesystem.
106106
///
@@ -141,7 +141,7 @@ pub mod vfs {
141141
}
142142
}
143143

144-
#[cfg(all(feature = "experimental", feature = "alloc"))]
144+
#[cfg(feature = "alloc")]
145145
impl<T> Drop for MountedFatfs<T> {
146146
fn drop(&mut self) {
147147
let drive_path = crate::fs::fatfs::Fatfs::<()>::drive_path_from(self.drive);
@@ -155,21 +155,13 @@ pub mod vfs {
155155
}
156156

157157
/// Represents a mounted Littlefs filesystem.
158-
#[cfg(all(
159-
feature = "experimental",
160-
feature = "alloc",
161-
esp_idf_comp_joltwallet__littlefs_enabled
162-
))]
158+
#[cfg(all(feature = "alloc", esp_idf_comp_joltwallet__littlefs_enabled))]
163159
pub struct MountedLittlefs<T> {
164160
_littlefs: T,
165161
partition_raw_data: crate::fs::littlefs::PartitionRawData,
166162
}
167163

168-
#[cfg(all(
169-
feature = "experimental",
170-
feature = "alloc",
171-
esp_idf_comp_joltwallet__littlefs_enabled
172-
))]
164+
#[cfg(all(feature = "alloc", esp_idf_comp_joltwallet__littlefs_enabled))]
173165
impl<T> MountedLittlefs<T> {
174166
/// Mount a Littlefs filesystem.
175167
///
@@ -256,11 +248,7 @@ pub mod vfs {
256248
}
257249
}
258250

259-
#[cfg(all(
260-
feature = "experimental",
261-
feature = "alloc",
262-
esp_idf_comp_joltwallet__littlefs_enabled
263-
))]
251+
#[cfg(all(feature = "alloc", esp_idf_comp_joltwallet__littlefs_enabled))]
264252
impl<T> Drop for MountedLittlefs<T> {
265253
fn drop(&mut self) {
266254
use crate::fs::littlefs::PartitionRawData;

src/lib.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ extern crate std;
2727
extern crate alloc;
2828

2929
#[cfg(not(esp32s2))]
30-
#[cfg(all(
31-
esp_idf_bt_enabled,
32-
esp_idf_bt_bluedroid_enabled,
33-
feature = "alloc",
34-
feature = "experimental"
35-
))]
30+
#[cfg(all(esp_idf_bt_enabled, esp_idf_bt_bluedroid_enabled, feature = "alloc",))]
3631
pub mod bt;
3732
#[cfg(all(
3833
not(esp32h2),
@@ -58,7 +53,6 @@ pub mod espnow;
5853
pub mod eth;
5954
#[cfg(all(feature = "alloc", esp_idf_comp_esp_event_enabled))]
6055
pub mod eventloop;
61-
#[cfg(feature = "experimental")]
6256
pub mod fs;
6357
pub mod hal;
6458
pub mod handle;
@@ -90,10 +84,7 @@ pub mod nvs;
9084
any(esp_idf_comp_spi_flash_enabled, esp_idf_comp_esp_partition_enabled)
9185
))]
9286
pub mod ota;
93-
#[cfg(all(
94-
feature = "experimental",
95-
any(esp_idf_comp_spi_flash_enabled, esp_idf_comp_esp_partition_enabled)
96-
))]
87+
#[cfg(any(esp_idf_comp_spi_flash_enabled, esp_idf_comp_esp_partition_enabled))]
9788
pub mod partition;
9889
#[cfg(esp_idf_comp_esp_netif_enabled)]
9990
pub mod ping;
@@ -103,7 +94,6 @@ pub mod sys;
10394
pub mod systime;
10495
#[cfg(all(
10596
feature = "alloc",
106-
feature = "experimental",
10797
esp_idf_comp_openthread_enabled,
10898
esp_idf_openthread_enabled,
10999
esp_idf_comp_esp_event_enabled,

0 commit comments

Comments
 (0)