-
Notifications
You must be signed in to change notification settings - Fork 389
Use zerocopy in place of references for the definition of PartitionEntry #4839
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
base: main
Are you sure you want to change the base?
Conversation
| if #[cfg(feature = "esp32")] { | ||
| let paddr = unsafe { | ||
| ((0x3FF10000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(feature = "esp32s2")] { | ||
| let paddr = unsafe { | ||
| (((0x61801000 + 128 * 4) as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(feature = "esp32s3")] { | ||
| // Revisit this once we support XiP from PSRAM for ESP32-S3 | ||
| let paddr = unsafe { | ||
| ((0x600C5000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(any(feature = "esp32c2", feature = "esp32c3"))] { | ||
| let paddr = unsafe { | ||
| ((0x600c5000 as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else if #[cfg(any(feature = "esp32c6", feature = "esp32h2"))] { | ||
| let paddr = unsafe { | ||
| ((0x60002000 + 0x380) as *mut u32).write_volatile(0); | ||
| (((0x60002000 + 0x37c) as *const u32).read_volatile() & 0xff) << 16 | ||
| }; | ||
| } else { | ||
| compile_error!("Paddr not defined for the current esp32 device, check if you have enabled it, or raise an issue about it"); |
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.
Can we use the PACs here?
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 think with the exception of H2/C6 we don't have the necessary registers in the SVDs, yet. (Ofc we should add them)
But I think this code is duplicated - so we should at least de-dup it
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packagescommand to ensure that all changed code is formatted correctly.CHANGELOG.mdin the proper section.Extra:
Pull Request Details 📖
Use zerocopy in place of references to define PartitionEntry.
Details are provided in issue
Testing
command ran: