; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
src_dir = examples/pio-arduino/src
data_dir = examples/pio-arduino/data

; src_dir = examples/websockets/src
; data_dir = examples/websockets/data

; src_dir = examples/arduino
; data_dir = examples/arduino/data

; src_dir = examples/arduino/arduino_captive_portal
; data_dir = examples/arduino/arduino_captive_portal/data

; src_dir = examples/arduino/arduino_ota
; data_dir = examples/arduino/arduino_ota/data

; NOTE: examples/esp-idf-pio uses framework = espidf and CANNOT be built from
; this root platformio.ini — ESP-IDF framework requires CMake to run from the
; project root, which conflicts with the library's root CMakeLists.txt.
; Build it standalone: cd examples/esp-idf-pio && pio run

[env]
platform = espressif32
framework = arduino
board = esp32-s3-devkitc-1
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
board_build.partitions = partitions-4MB.csv
board_build.filesystem = littlefs
lib_deps =
    symlink://.
    bblanchon/ArduinoJson@^7.4.3
lib_ignore =
    examples
build_flags =
    -Wall
    -Wextra
    -Wno-missing-field-initializers
    -Og
    -D CONFIG_ARDUHAL_LOG_COLORS
    -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
    -I${PROJECT_DIR}


[env:arduino2]
platform = espressif32@7.0.1

[env:arduino2-ssl]
platform = espressif32@7.0.1
build_flags = -DPSY_ENABLE_SSL

[env:arduino2-regex]
platform = espressif32@7.0.1
build_flags = -DPSY_ENABLE_REGEX

[env:arduino3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

[env:arduino3-ssl]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
build_flags = -DPSY_ENABLE_SSL

[env:arduino3-regex]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
build_flags = -D PSY_ENABLE_REGEX

[env:arduino3-arduinojson6]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
lib_deps =
    symlink://.
    bblanchon/ArduinoJson@^6.21.5

[env:arduino3-static-websocket]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
build_flags = 
    -D PSYCHIC_WS_MAX_FRAME_SIZE=3000
    -D PSYCHIC_WS_RX_STATIC_BUFFER


[env:pioarduino-c6]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32-c6-devkitc-1

[env:ci-matrix]
platform = ${sysenv.PIO_PLATFORM}
board = ${sysenv.PIO_BOARD}