diff --git a/firmware/acid-firmware/src/db/mod.rs b/firmware/acid-firmware/src/db/mod.rs index d8d1e97..0549f7c 100644 --- a/firmware/acid-firmware/src/db/mod.rs +++ b/firmware/acid-firmware/src/db/mod.rs @@ -16,6 +16,8 @@ use esp_hal::rng::Trng; use esp_storage::FlashStorage; use log::{debug, info}; +use crate::ram::PSRAM_ALLOCATOR; + pub type PartitionAcid = Partition<'static, CriticalSectionRawMutex, BlockingAsync>>; @@ -25,7 +27,7 @@ struct AlignedBuf(pub [u8; N]); pub struct EkvFlash { flash: T, - buffer: Box>, + buffer: Box, &'static esp_alloc::EspHeap>, } impl EkvFlash { @@ -34,7 +36,7 @@ impl EkvFlash { flash, buffer: { // Allocate the buffer directly on the heap. - let buffer = Box::new_zeroed(); + let buffer = Box::new_zeroed_in(&PSRAM_ALLOCATOR); unsafe { buffer.assume_init() } }, }