-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark unstable modules, make macros
private
#2900
base: main
Are you sure you want to change the base?
Conversation
macros
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll review the code separately soon, but for now I just generated the docs to take a look around.
I believe the following modules still need to be unstable:
- efuse
- asynch
- lp_core
The clock
changes are handled in so we don't need to worry about that one: #2899
Oops, forgot about them. Then |
a75c65f
to
40d263d
Compare
|
What's the reason to make all macros private? Part of that module is public reexports, and we're now reexporting reexported macros? |
@@ -234,8 +234,8 @@ impl RegisterAccess for crate::peripherals::ADC1 { | |||
fn set_init_code(data: u16) { | |||
let [msb, lsb] = data.to_be_bytes(); | |||
|
|||
crate::regi2c_write_mask!(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, msb as u32); | |||
crate::regi2c_write_mask!(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, lsb as u32); | |||
crate::rom::regi2c_write_mask!(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, msb as u32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro should probably live in an internal_analog
or similar module, rom seems somewhat random to me - it's expanding into a rom function, sure, but if that would be the driving force behind code organization we could just have a big rust.rs
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this - should it get fixed in this PR or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm also not sure 😄
After a long fight me and @bugadani decided to leave things as they are because another options (pub unstable macros module) don't seem to be working (also, macros are cursed) |
40d263d
to
6a8a003
Compare
@@ -156,28 +154,28 @@ pub use xtensa_lx_rt::{self, entry}; | |||
#[cfg(any(esp32, esp32s3))] | |||
pub use self::soc::cpu_control; | |||
#[cfg(efuse)] | |||
#[instability::unstable] | |||
#[cfg_attr(not(feature = "unstable"), allow(unused))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably something that can be fixed in instability.
ddf635d
to
f4cfbe0
Compare
UPD: marked Also, it doesn't make sense to stabilize UPD: #[instability::unstable]
#[cfg_attr(not(feature = "unstable"), allow(unused))]
pub use procmacros::{handler, ram}; seems to be resolving the issue with |
|
Exactly, that's what I'm talking about 😅 Which means, we need to either
|
f4cfbe0
to
69d154d
Compare
esp-hal-procmacros is basically tied to esp-hal, the only reason they're in separate a crate is due to compiler limitations, so we'll actually need to make esp-hal-procmacros 1.0 too. I hadn't considered this initially, but this should be fine though, because everything that's in there can also be marked as unstable, and we can do the following:
I suggest we do this in a follow up PR though, as this will involve a bunch more changes. I'll open an issue for this. |
69d154d
to
ce49ee6
Compare
07aa760
to
6588f54
Compare
Description
closes #2499
potentially closes #2921
Marked the rest of unstable modules.
Makes
macros
module private (otherwise, it'll cause a huge and noisy diff likecrate::before_snippet!
->crate::macros::before_snippet
and so on) as it was public only to reexport a couple of things fromprocmacros
.Adding small "default" branch in
esp_hal::init
function (caused by instability ofwatchdog
andpsram
items ofConfig
)Since
rom
is also unstable, we need that bad-lookingpub use
construction forregi2c_write
andregi2c_write_mask
, which will be removed whenrom
is stabilized