-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsdkconfig.defaults
More file actions
56 lines (41 loc) · 1.93 KB
/
Copy pathsdkconfig.defaults
File metadata and controls
56 lines (41 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Project-wide sdkconfig overrides for microreader2.
# These values are merged into the generated sdkconfig.<env> on build.
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
# Enable FAT Long File Name support (needed for .epub filenames)
CONFIG_FATFS_LFN_HEAP=y
# Build a per-file cluster-link map so fseek() stays in RAM instead of
# re-traversing the FAT chain on every random access. ~29% faster conversion.
CONFIG_FATFS_USE_FASTSEEK=y
CONFIG_FATFS_USE_LABEL=y
# Main task needs enough stack for EPUB parsing (ZIP + XML + CSS) and
# for FatFS/SDSPI calls inside settings flows (clear cache, etc).
# IDF default is 3584 which is far too tight.
CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384
# --- RAM optimizations ---
# Optimize for performance (-O2) — faster CPU-bound inflate/XML parsing
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_COMPILER_OPTIMIZATION_DEBUG=n
# Use newlib nano printf (smaller code, no float support needed)
CONFIG_NEWLIB_NANO_FORMAT=y
# Move FreeRTOS functions to flash (slightly slower, saves IRAM)
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
# Use SPI flash ROM implementation (saves IRAM by using ROM code)
CONFIG_SPI_FLASH_ROM_IMPL=y
# Reduce ISR stack (default 1536, we have no heavy ISRs)
CONFIG_FREERTOS_ISR_STACKSIZE=1024
# Move heap allocator (tlsf) from IRAM to flash — saves ~3.5KB IRAM
CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH=y
# SPI master/slave ISR in flash — we don't do SPI during flash writes
CONFIG_SPI_MASTER_ISR_IN_IRAM=n
CONFIG_SPI_SLAVE_ISR_IN_IRAM=n
# No need to post events from IRAM ISR context
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n
# Reduce HAL assertions (silent = no format strings in IRAM)
CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=1
# Move libc lock functions to flash
CONFIG_LIBC_LOCKS_PLACE_IN_IRAM=n
# --- Internal task stack reductions (heap savings) ---
# We don't use esp_timer callbacks or event loops heavily
CONFIG_ESP_TIMER_TASK_STACK_SIZE=2048
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2048