# ESP32-S3 Configuration
CONFIG_IDF_TARGET="esp32s3"

# Flash size (16MB auf Waveshare Board)
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"

# PSRAM Configuration (8MB auf Waveshare Board)
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y

# Compiler optimizations for emulation
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y

# FreeRTOS Configuration
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_UNICORE=n

# Partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# Wi-Fi (optional, für zukünftige Features)
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32

# Task watchdog (disable for emulation, kann zu Problemen führen)
CONFIG_ESP_TASK_WDT=n

# Stack sizes
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=4096

# Enable C++ exceptions (für manche Components)
CONFIG_COMPILER_CXX_EXCEPTIONS=y

# Brownout detector (kann bei niedriger Batterie resetten)
CONFIG_ESP_BROWNOUT_DET=y
CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y

# Console output
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
CONFIG_ESP_CONSOLE_UART_NUM=0
CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200

# Logging
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE=y

# FAT Filesystem (für SD-Karte)
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_MAX_LFN=255

# SD Card
CONFIG_SDMMC_HOST_SLOT_1=y

# I2S (für Audio)
CONFIG_I2S_ENABLE_DEBUG_LOG=n

# SPI (für Display & SD)
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
