; PlatformIO Project Configuration File for EMS-ESP
; override any settings with your own local ones in pio_local.ini

[platformio]
default_envs = esp32

extra_configs = 
  factory_settings.ini
  pio_local.ini

[common]
core_build_flags =
  -Wall
  -D CORE_DEBUG_LEVEL=0
  -D NDEBUG
  -D ARDUINO_ARCH_ESP32=1
  -D ESP32=1

core_unbuild_flags =  

build_flags =
  ${common.core_build_flags}
  ${factory_settings.build_flags}
  -D ONEWIRE_CRC16=0
  -D NO_GLOBAL_ARDUINOOTA
  -D ARDUINOJSON_ENABLE_STD_STRING=1

unbuild_flags =
  ${common.core_unbuild_flags}

[env]
framework = arduino
monitor_speed = 115200
upload_speed = 921600
build_type = release
lib_ldf_mode = chain+

check_tool = cppcheck, clangtidy
check_severity = high, medium
check_flags =
  cppcheck: --std=c++11 -v
  clangtidy: --checks=-*,clang-analyzer-*,performance-*

; build for GitHub Actions CI
; the Web interface is built seperately
[env:ci]
extra_scripts = scripts/rename_fw.py
board = esp32dev
platform = espressif32
board_build.partitions = esp32_partition_app1984k_spiffs64k.csv 
build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags}

[env:esp32]
extra_scripts =
  pre:scripts/build_interface.py
  scripts/rename_fw.py
board = esp32dev
platform = espressif32
board_build.partitions = esp32_partition_app1984k_spiffs64k.csv
build_flags = ${common.build_flags}
build_unflags = ${common.unbuild_flags}
