[platformio]
default_envs = arduino-2, arduino-3, esp8266, raspberrypi
lib_dir = .
; src_dir = examples/AsyncResponseStream
; src_dir = examples/Auth
; src_dir = examples/CaptivePortal
; src_dir = examples/CatchAllHandler
; src_dir = examples/ChunkResponse
; src_dir = examples/ChunkRetryResponse
; src_dir = examples/CORS
; src_dir = examples/EndBegin
; src_dir = examples/Filters
; src_dir = examples/FlashResponse
; src_dir = examples/HeaderManipulation
; src_dir = examples/Json
; src_dir = examples/Logging
; src_dir = examples/MessagePack
; src_dir = examples/Middleware
; src_dir = examples/Params
; src_dir = examples/PartitionDownloader
src_dir = examples/PerfTests
; src_dir = examples/RateLimit
; src_dir = examples/Redirect
; src_dir = examples/RequestContinuation
; src_dir = examples/RequestContinuationComplete
; src_dir = examples/ResumableDownload
; src_dir = examples/Rewrite
; src_dir = examples/ServerSentEvents
; src_dir = examples/ServerState
; src_dir = examples/SkipServerMiddleware
; src_dir = examples/SlowChunkResponse
; src_dir = examples/StaticFile
; src_dir = examples/Templates
; src_dir = examples/Upload
; src_dir = examples/WebSocket
; src_dir = examples/WebSocketEasy

[env]
framework = arduino
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
board = esp32dev
build_flags =
  -Og
  -Wall -Wextra
  -Wno-unused-parameter
  ; -D CONFIG_ARDUHAL_LOG_COLORS
  -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
  -D CONFIG_ASYNC_TCP_MAX_ACK_TIME=5000
  -D CONFIG_ASYNC_TCP_PRIORITY=10
  -D CONFIG_ASYNC_TCP_QUEUE_SIZE=64
  -D CONFIG_ASYNC_TCP_RUNNING_CORE=1
  -D CONFIG_ASYNC_TCP_STACK_SIZE=4096
  ; -D CONFIG_ASYNC_TCP_USE_WDT=0
upload_protocol = esptool
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, log2file
; monitor_filters = esp8266_exception_decoder, log2file
lib_compat_mode = strict
lib_ldf_mode = chain
lib_deps =
  bblanchon/ArduinoJson @ 7.4.1
  ESP32Async/AsyncTCP @ 3.4.0
board_build.partitions = partitions-4MB.csv
board_build.filesystem = littlefs

[env:arduino-2]
platform = espressif32@6.10.0

[env:arduino-3]

[env:arduino-3-latest]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20-rc2/platform-espressif32.zip

[env:arduino-3-no-json]
lib_deps =
  ESP32Async/AsyncTCP @ 3.4.0

[env:arduino-3-latest-asynctcp]
lib_deps =
  https://github.com/ESP32Async/AsyncTCP

[env:arduino-3-no-chunk-inflight]
build_flags = ${env.build_flags}
  -D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=0

[env:AsyncTCPSock]
lib_deps =
  https://github.com/ESP32Async/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip
build_flags = ${env.build_flags}

[env:esp8266]
platform = espressif8266
; board = huzzah
board = d1_mini
lib_deps =
  bblanchon/ArduinoJson @ 7.4.1
  ESP32Async/ESPAsyncTCP @ 2.0.0

[env:raspberrypi]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#c7502925e3b08af70e9f924d54ab9d00a7e64781
board = rpipicow
board_build.core = earlephilhower
lib_deps =
  bblanchon/ArduinoJson @ 7.3.0
  ayushsharma82/RPAsyncTCP@^1.3.2
lib_ignore =
  lwIP_ESPHost
build_flags = ${env.build_flags}
  -Wno-missing-field-initializers

;  CI

[env:ci-arduino-2]
platform = espressif32@6.10.0
board = ${sysenv.PIO_BOARD}

[env:ci-arduino-3]
board = ${sysenv.PIO_BOARD}

[env:ci-arduino-3-latest]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20-rc2/platform-espressif32.zip
board = ${sysenv.PIO_BOARD}

[env:ci-arduino-3-no-json]
board = ${sysenv.PIO_BOARD}
lib_deps =
  ESP32Async/AsyncTCP @ 3.4.0

[env:ci-arduino-3-latest-asynctcp]
lib_deps =
  https://github.com/ESP32Async/AsyncTCP

[env:ci-arduino-3-no-chunk-inflight]
board = ${sysenv.PIO_BOARD}
build_flags = ${env.build_flags}
  -D ASYNCWEBSERVER_USE_CHUNK_INFLIGHT=1

[env:ci-esp8266]
platform = espressif8266
board = ${sysenv.PIO_BOARD}
lib_deps =
  bblanchon/ArduinoJson @ 7.4.1
  ESP32Async/ESPAsyncTCP @ 2.0.0

[env:ci-raspberrypi]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#c7502925e3b08af70e9f924d54ab9d00a7e64781
board = ${sysenv.PIO_BOARD}
board_build.core = earlephilhower
lib_deps =
  bblanchon/ArduinoJson @ 7.3.0
  ayushsharma82/RPAsyncTCP@^1.3.2
lib_ignore =
  lwIP_ESPHost
build_flags = ${env.build_flags}
  -Wno-missing-field-initializers
