[platformio]
default_envs = arduino-2, arduino-3, arduino-libretiny
lib_dir = .
; src_dir = examples/Client
; src_dir = examples/FetchWebsite
src_dir = examples/AsyncSend

[env]
framework = arduino
build_flags = 
  -Wall -Wextra
  -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_ARDUHAL_LOG_COLORS
  ; -D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
  ; -D USE_ESP_IDF_LOG=1
  ; -D LOG_LOCAL_LEVEL=ESP_LOG_VERBOSE
  ; -D CONFIG_ASYNC_TCP_DEBUG
upload_protocol = esptool
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, log2file
board = esp32dev

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

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

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

[env:arduino-libretiny]
platform = libretiny
board = generic-bk7231n-qfn32-tuya
; board = generic-rtl8710bn-2mb-788k
build_flags =
  ${env.build_flags}
  -Wno-unused-parameter
  -Wno-unused-variable
  -Wno-missing-field-initializers
; use FreeRTOS v9.0.0 for RTL8710BN
; (BK7231 already uses it)
custom_versions.freertos = 9.0.0

;  CI

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

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

[env:ci-arduino-2-esp-idf_log]
platform = espressif32@6.12.0
board = ${sysenv.PIO_BOARD}
build_flags =
  ${env.build_flags}
  -D USE_ESP_IDF_LOG=1
  -D TAG=\"core\"

[env:ci-arduino-3-esp-idf_log]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.31/platform-espressif32.zip
board = ${sysenv.PIO_BOARD}
build_flags =
  ${env.build_flags}
  -D USE_ESP_IDF_LOG=1

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

[env:ci-arduino-libretiny]
platform = libretiny
board = ${sysenv.PIO_BOARD}
build_flags =
  ${env.build_flags}
  -Wno-unused-parameter
  -Wno-unused-variable
  -Wno-missing-field-initializers
custom_versions.freertos = 9.0.0
