# sdkconfig.defaults — Zacus master ESP-IDF scaffold (P1 first slice)
#
# Target: Freenove ESP32-S3 WROOM N16R8 (8 MB Octal PSRAM, 16 MB flash).
# Provides the minimum config to boot, mount LittleFS, and run the inherited
# ota_server component. Voice / NPC / vision configs come in later P1 slices.

# ─── Target ──────────────────────────────────────────────────────────────────
CONFIG_IDF_TARGET="esp32s3"
CONFIG_IDF_TARGET_ESP32S3=y

# ─── Flash ───────────────────────────────────────────────────────────────────
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y

# ─── PSRAM (Octal 80 MHz, required for esp-sr buffers in P3+) ────────────────
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y

# ─── Partition table (custom, supports OTA + LittleFS dual boot) ─────────────
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# ─── HTTP server (used by ota_server, port 80) ───────────────────────────────
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
CONFIG_HTTPD_MAX_URI_LEN=512

# ─── Wi-Fi (STA + AP fallback for first-boot provisioning) ───────────────────
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP_WIFI_NVS_ENABLED=y
CONFIG_LWIP_LOCAL_HOSTNAME="zacus-master"

# ─── FreeRTOS ────────────────────────────────────────────────────────────────
CONFIG_FREERTOS_HZ=1000

# ─── Logging ─────────────────────────────────────────────────────────────────
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_COLORS=y

# ─── Bootloader / OTA rollback ───────────────────────────────────────────────
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y

# ─── ESP-SR (slice 6 — voice_pipeline) ───────────────────────────────────────
# Standard placeholder wake-word: "Hi ESP" (wn9_hiesp). Custom Zacus model
# is out of scope here (Espressif training, P4 voice spec). Keep MultiNet
# disabled — STT happens off-device on MacStudio (whisper). Disabling MN
# saves >1 MB of flash + lots of PSRAM at runtime.
CONFIG_SR_WN_WN9_HIESP=y
CONFIG_SR_MN_CN_NONE=y
CONFIG_SR_MN_EN_NONE=y
CONFIG_MODEL_IN_FLASH=y
CONFIG_AFE_INTERFACE_V1=y

# LVGL (display_ui phase 2a) — mirrors original ui_freenove_allinone lv_conf.h:
# depth 16 + swap 0 are lvgl defaults; Montserrat 24/28 enabled. Mem pool 48KB
CONFIG_LV_MEM_SIZE_KILOBYTES=48
CONFIG_LV_FONT_MONTSERRAT_24=y
CONFIG_LV_FONT_MONTSERRAT_28=y

# LVGL file access + PNG icons (shell apps from littlefs)
CONFIG_LV_USE_FS_STDIO=y
CONFIG_LV_FS_STDIO_LETTER=76
CONFIG_LV_FS_STDIO_PATH="/littlefs"
CONFIG_LV_USE_PNG=y

# P4: FATFS Long File Names (heap) — assets sur SD ont des noms > 8.3
# (SCENE_WIN.mp3, sonar_hint.mp3, hotline_tts/…). Sans ça fopen échoue.
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_MAX_LFN=255
