; 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]
data_dir = data/build

[env]
platform = espressif32
framework = arduino, espidf
monitor_speed = 115200
upload_speed = 921600
monitor_filters = esp32_exception_decoder, colorize
extra_scripts = post:scripts/extra_script.py
build_flags = !python scripts/git_rev.py

[esp32wemos-s3-mini_BW_base]
platform = espressif32
framework = arduino, espidf
board = lolin_s3_mini
board_build.partitions = partition.csv
lib_deps = 
    bblanchon/ArduinoJson@^6.21.2
    fbiego/ESP32Time@^2.0.1
    adafruit/Adafruit MCP23017 Arduino Library@^2.3.0
    adafruit/Adafruit NeoPixel@^1.11.0
    https://github.com/me-no-dev/ESPAsyncWebServer.git
    https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2
build_flags =
  !python scripts/git_rev.py
  -DLAST_BUILD_TIME=$UNIX_TIME
  -D IS_S3
  -D IS_BW
  -D CONFIG_FREERTOS_USE_TRACE_FACILITY
  -D WITH_RGB_LED
  -D NEOPIXEL_COUNT=4
  -DASYNCWEBSERVER_REGEX
  -D WITH_BUTTONS
  -D ARDUINO_USB_CDC_ON_BOOT
  -D HOSTNAME="\"btclock3\""
  -mfix-esp32-psram-cache-issue
  -fexceptions
  -DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS
build_unflags = 
  -fno-exceptions
  -Werror=all

  zinggjm/GxEPD2@^1.5.2

[env:esp32wemos-s3-mini_BW]
extends = esp32wemos-s3-mini_BW_base
build_flags =
  ${esp32wemos-s3-mini_BW_base.build_flags}
  https://github.com/dsbaars/GxEPD2#universal_pin
  https://github.com/dsbaars/universal_pin
  -DUSE_UNIVERSAL_PIN
  -D NUM_SCREENS=7
lib_deps =
  ${esp32wemos-s3-mini_BW_base.lib_deps}

[env:esp32wemos-s3-mini_BW_9disp]
extends = esp32wemos-s3-mini_BW_base
build_flags =
  ${esp32wemos-s3-mini_BW_base.build_flags}
  -D NUM_SCREENS=9

[env:default]
extends = esp32wemos-s3-mini_BW_base
build_flags =
  ${esp32wemos-s3-mini_BW_base.build_flags}
  -D NUM_SCREENS=7
lib_deps =
    ${esp32wemos-s3-mini_BW_base.lib_deps}
    zinggjm/GxEPD2@^1.5.2