mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 06:40:47 +00:00
Document that atomics in psram don't work (#3379)
This commit is contained in:
parent
11ba2509d2
commit
e697c62cfd
@ -28,14 +28,21 @@ macro_rules! heap_allocator {
|
|||||||
|
|
||||||
/// Initialize a global heap allocator backed by PSRAM
|
/// Initialize a global heap allocator backed by PSRAM
|
||||||
///
|
///
|
||||||
/// You need a SoC which supports PSRAM
|
/// You need a SoC which supports PSRAM and activate the feature to enable
|
||||||
/// and activate the feature to enable it. You need to pass the PSRAM peripheral
|
/// it. You need to pass the PSRAM peripheral and the psram module path.
|
||||||
/// and the psram module path.
|
|
||||||
///
|
///
|
||||||
/// # Usage
|
/// # Usage
|
||||||
|
///
|
||||||
/// ```rust, no_run
|
/// ```rust, no_run
|
||||||
/// esp_alloc::psram_allocator!(peripherals.PSRAM, hal::psram);
|
/// esp_alloc::psram_allocator!(peripherals.PSRAM, hal::psram);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// # ⚠️ Limitations
|
||||||
|
///
|
||||||
|
/// On ESP32, ESP32-S2 and ESP32-S3 the atomic instructions do not work
|
||||||
|
/// correctly when the memory they access is located in PSRAM. This means that
|
||||||
|
/// the allocator must not be used to allocate `Atomic*` types - either directly
|
||||||
|
/// or indirectly. Be very careful when using PSRAM in your global allocator.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! psram_allocator {
|
macro_rules! psram_allocator {
|
||||||
($peripheral:expr, $psram_module:path) => {{
|
($peripheral:expr, $psram_module:path) => {{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user