Conditional platformio.ini options

Just create yet another working environment with custom options and extend the original

[env]
check_skip_packages = yes
platform = espressif32
board = esp-wrover-kit
framework = arduino, espidf
board_build.filesystem = littlefs

;upload_protocol = espota
;upload_port     = 192.168.10.107
upload_speed    = 921600

monitor_speed   = 115200
monitor_filters = colorize, esp32_exception_decoder

board_upload.flash_size = 16MB
board_build.flash_mode = qio
board_build.partitions = ./Partitions/hshPartition_APP_3MB.csv
board_build.f_cpu   = 240000000L
board_build.f_flash = 80000000L


build_flags = 
    -DBOARD_HAS_PSRAM
    -mfix-esp32-psram-cache-issue
    -mfix-esp32-psram-cache-strategy=memw
    -DCONFIG_SPIRAM_USE_MALLOC=1
    -DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1
    -DCONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=1
    -DCONFIG_SPIRAM_CACHE_WORKAROUND=1
    -DCORE_DEBUG_LEVEL=0
    -std=gnu++17

build_unflags =
    -std=gnu++11

[env:esp-wrover-kit-ota]
upload_protocol = espota
upload_port     = 192.168.10.107
upload_flags =
     --auth=admin_test_password
...


[env:esp-wrover-kit-skip-ota]

See extends — PlatformIO latest documentation

1 Like