Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Add support for nightly allocator_api-feature #17

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

seijikun
Copy link
Contributor

@seijikun seijikun commented Mar 2, 2024

I want to write an application using the ESP32S3's LCD peripheral.
This peripheral works by allocating a framebuffer that contains the entire display content (For me: 800 x 480 pxl) and then streaming that out to the LCD using DMA.
For obvious reasons, this allocation has to be done in PSRAM, not in DRAM.

I haven't found a way to do that except for using Vec::with_capacity_in - which requires the nightly only allocator_api.

This PR implements support for this feature.
I also added some easy getting started documentation on the docs frontpage while I was at it.

@seijikun seijikun force-pushed the main branch 2 times, most recently from 720b336 to ad1e8e2 Compare March 2, 2024 20:13
@seijikun
Copy link
Contributor Author

seijikun commented Mar 2, 2024

Okay, extremely weird. The GitHub PR preview shows

let large_buffer: Vec<u8, _> = Vec::with_capacity(1048576, &PSRAM_ALLOCATOR);

even though the code in that line actually is:

let large_buffer: Vec<u8, _> = Vec::with_capacity_in(1048576, &PSRAM_ALLOCATOR);

So you can ignore that - only a GitHub bug.

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, I wasn't aware of this feature!

I think you're just running into some browser caching issues or something, as the line you mentioned is displayed correctly for me!

@jessebraham jessebraham merged commit 37aa110 into esp-rs:main Mar 4, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants