Skip to content

Commit 40d263d

Browse files
committed
address reviews
1 parent 881ba35 commit 40d263d

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

esp-hal/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9696
- UART: Remove blocking version of `read_bytes` and rename `drain_fifo` to `read_bytes` instead (#2895)
9797
- Renamed variants of `CpuClock`, made the enum non-exhaustive (#2899)
9898
- SPI: Fix naming violations for `Mode` enum variants (#2902)
99+
- `macros` module is now private (#2900)
99100

100101
### Fixed
101102

esp-hal/MIGRATING-0.22.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,13 @@ The SPI mode variants are renamed from e.g. `Mode0` to `_0`.
414414
- Mode::Mode0
415415
+ Mode::_0
416416
```
417+
418+
## `macro` module is private now
419+
420+
Macros from `procmacros` crate (`handler`, `ram`, `load_lp_code`) are now imported via `esp-hal`.
421+
422+
```diff
423+
- use esp_hal::macros::{handler, ram, load_lp_code};
424+
+ use esp_hal::{handler, ram, load_lp_code};
425+
```
426+

esp-hal/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@
143143
// MUST be the first module
144144
mod fmt;
145145

146-
pub mod asynch;
147-
148146
#[cfg(riscv)]
149147
pub use esp_riscv_rt::{self, entry, riscv};
150148
#[cfg(xtensa)]
@@ -156,13 +154,17 @@ pub use xtensa_lx_rt::{self, entry};
156154
#[cfg(any(esp32, esp32s3))]
157155
pub use self::soc::cpu_control;
158156
#[cfg(efuse)]
157+
#[cfg(feature = "unstable")]
159158
pub use self::soc::efuse;
160159
#[cfg(lp_core)]
160+
#[cfg(feature = "unstable")]
161161
pub use self::soc::lp_core;
162162
pub use self::soc::peripherals;
163+
#[cfg(feature = "unstable")]
163164
#[cfg(any(feature = "quad-psram", feature = "octal-psram"))]
164165
pub use self::soc::psram;
165166
#[cfg(ulp_riscv_core)]
167+
#[cfg(feature = "unstable")]
166168
pub use self::soc::ulp_core;
167169

168170
#[cfg(any(dport, hp_sys, pcr, system))]
@@ -216,6 +218,7 @@ unstable_module! {
216218
pub mod aes;
217219
#[cfg(any(adc, dac))]
218220
pub mod analog;
221+
pub mod asynch;
219222
#[cfg(assist_debug)]
220223
pub mod assist_debug;
221224
pub mod config;
@@ -541,7 +544,7 @@ pub fn init(config: Config) -> Peripherals {
541544

542545
// Handle watchdog configuration with defaults
543546
cfg_if::cfg_if! {
544-
if #[cfg(any(doc, feature = "unstable"))]
547+
if #[cfg(feature = "unstable")]
545548
{
546549
#[cfg(not(any(esp32, esp32s2)))]
547550
if config.watchdog.swd {

esp-hal/src/rom/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ extern "C" {
4444
);
4545
}
4646

47-
#[doc(hidden)]
48-
#[macro_export]
4947
macro_rules! regi2c_write {
5048
( $block: ident, $reg_add: ident, $indata: expr ) => {
5149
paste::paste! {
@@ -62,10 +60,9 @@ macro_rules! regi2c_write {
6260
};
6361
}
6462

65-
pub use regi2c_write; // TODO: can be removed as soon as ROM is stabilized
63+
#[allow(unused_imports)]
64+
pub(crate) use regi2c_write;
6665

67-
#[doc(hidden)]
68-
#[macro_export]
6966
macro_rules! regi2c_write_mask {
7067
( $block: ident, $reg_add: ident, $indata: expr ) => {
7168
paste::paste! {
@@ -84,7 +81,8 @@ macro_rules! regi2c_write_mask {
8481
};
8582
}
8683

87-
pub use regi2c_write_mask; // TODO: can be removed as soon as ROM is stabilized
84+
#[allow(unused_imports)]
85+
pub(crate) use regi2c_write_mask;
8886

8987
#[inline(always)]
9088
pub(crate) fn ets_delay_us(us: u32) {

examples/src/bin/flash_read_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Uses flash address 0x9000 (default NVS)
44
//! See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html#built-in-partition-tables
55
6-
//% FEATURES: esp-storage
6+
//% FEATURES: esp-storage esp-hal/unstable
77
//% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3
88

99
#![no_std]

0 commit comments

Comments
 (0)