Skip to content

Commit 37e6965

Browse files
committed
feat: extend heap size for v3 hardware (esp32c3)
1 parent c0ebd75 commit 37e6965

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use esp_storage::FlashStorage;
2121
use state::{ota_state, sleep_state, GlobalStateInner, SavedGlobalState, Scene};
2222
use structs::ConnSettings;
2323
use utils::{logger::FkmLogger, set_brownout_detection};
24+
use ws_framer::{WsUrl, WsUrlOwned};
2425

2526
#[cfg(feature = "esp32")]
2627
use esp_hal::time::RateExtU32;
27-
use ws_framer::{WsUrl, WsUrlOwned};
2828

2929
mod battery;
3030
mod buttons;
@@ -82,10 +82,15 @@ async fn main(spawner: Spawner) {
8282
esp_alloc::heap_allocator!(120 * 1024);
8383
}
8484

85-
#[cfg(feature = "esp32")]
8685
{
86+
#[cfg(feature = "esp32")]
87+
const HEAP_SIZE: usize = 90 * 1024;
88+
89+
#[cfg(not(feature = "esp32"))]
90+
const HEAP_SIZE: usize = 60 * 1024;
91+
8792
#[link_section = ".dram2_uninit"]
88-
static mut HEAP2: core::mem::MaybeUninit<[u8; 90 * 1024]> =
93+
static mut HEAP2: core::mem::MaybeUninit<[u8; HEAP_SIZE]> =
8994
core::mem::MaybeUninit::uninit();
9095

9196
#[allow(static_mut_refs)]

0 commit comments

Comments
 (0)