; Try to not create new configs if possible, if in doubt, please ask
; OTA on the official repo will only be published for mass-produced APs, feel free to experiment on your own fork
[env]
platform = espressif32
framework = arduino
lib_deps = 
	https://github.com/esphome/ESPAsyncWebServer
	https://github.com/esphome/AsyncTCP

	bblanchon/ArduinoJson@^6.19.4
	bodmer/TFT_eSPI
	https://github.com/Bodmer/TJpg_Decoder.git
	https://github.com/nlimper/shoddyxml2
	https://github.com/nlimper/QRCodeGenerator
	fastled/FastLED@3.7.8
	https://github.com/MajenkoLibraries/SoftSPI
platform_packages =
    platformio/framework-arduinoespressif32 @ 3.20014.231204
board_build.filesystem = littlefs
monitor_filters = esp32_exception_decoder
monitor_speed = 115200
board_build.f_cpu = 240000000L
build_unflags =
	-std=gnu++11
build_flags =
	-std=gnu++17
	-D BUILD_ENV_NAME=$PIOENV
	-D BUILD_TIME=$UNIX_TIME
	-D USER_SETUP_LOADED
	-D DISABLE_ALL_LIBRARY_WARNINGS
	-D ILI9341_DRIVER
	-D SMOOTH_FONT
upload_port = COM26
monitor_port = COM26
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the Mini_AP
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Mini_AP]
platform = https://github.com/platformio/platform-espressif32.git
board=lolin_s2_mini
board_build.partitions = default.csv
build_unflags =
	-std=gnu++11
	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D OPENEPAPERLINK_MINI_AP_PCB
	-D ARDUINO_USB_MODE=0
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_RGB_LED
	-D BOARD_HAS_PSRAM
	-D SAVE_SPACE
	-D POWER_NO_SOFT_POWER
	-D FLASHER_AP_SS=11
	-D FLASHER_AP_CLK=9
	-D FLASHER_AP_MOSI=10
	-D FLASHER_AP_MISO=8
	-D FLASHER_AP_RESET=13
  	-D FLASHER_AP_POWER={-1} ;this board has no soft power control
  	-D FLASHER_AP_TXD=7
  	-D FLASHER_AP_RXD=6
  	-D FLASHER_AP_TEST=12
  	-D FLASHER_LED=15
  	-D FLASHER_RGB_LED=33
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>-<ips_display.cpp>-<webflasher.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the Nano_AP
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Nano_AP]
platform = https://github.com/platformio/platform-espressif32.git
board=lolin_s2_mini
board_build.partitions = default.csv
build_unflags =
	-std=gnu++11
	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D OPENEPAPERLINK_NANO_AP_PCB
	-D ARDUINO_USB_MODE=0
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D BOARD_HAS_PSRAM
	-D SAVE_SPACE
	-D FLASHER_AP_SS=38
	-D FLASHER_AP_CLK=40
	-D FLASHER_AP_MOSI=39
	-D FLASHER_AP_MISO=33
	-D FLASHER_AP_RESET=37
  	-D FLASHER_AP_POWER={16,17,18,21}
  	-D FLASHER_AP_TXD=35
  	-D FLASHER_AP_RXD=34
  	-D FLASHER_AP_TEST=36
  	-D FLASHER_LED=15
  	-D FLASHER_RGB_LED=-1
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>-<ips_display.cpp>-<webflasher.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the 16MB Flash / 8MB Ram version of the ESP32-S3-DevkitC1
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_AP_and_Flasher]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32-s3-devkitc-1
board_build.partitions = default_16MB.csv
build_unflags =
	-std=gnu++11
	-D ARDUINO_USB_MODE=1
	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_EXT_FLASHER
	-D ARDUINO_USB_MODE=0
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D HAS_USB
	-D HAS_RGB_LED
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D POWER_RAMPING
	-D POWER_HIGH_SIDE_DRIVER
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=4
	-D FLASHER_AP_CLK=5
	-D FLASHER_AP_MOSI=7
	-D FLASHER_AP_MISO=6
	-D FLASHER_AP_RESET=15
	-D FLASHER_AP_POWER={0} 
	-D FLASHER_AP_TXD=16
	-D FLASHER_AP_RXD=18
	-D FLASHER_AP_TEST=17
	-D FLASHER_EXT_SS=40
	-D FLASHER_EXT_CLK=41
	-D FLASHER_EXT_MOSI=2
	-D FLASHER_EXT_MISO=42
	-D FLASHER_EXT_RESET=1
	-D FLASHER_EXT_POWER={8}
	-D FLASHER_EXT_TXD=38
	-D FLASHER_EXT_RXD=39
	-D FLASHER_EXT_TEST=47
	-D FLASHER_ALT_SS=3
	-D FLASHER_ALT_CLK=46
	-D FLASHER_ALT_MOSI=10
	-D FLASHER_ALT_MISO=9
	-D FLASHER_ALT_RESET=11
	-D FLASHER_ALT_POWER={-1}
	-D FLASHER_ALT_TXD=12
	-D FLASHER_ALT_RXD=14
	-D FLASHER_ALT_TEST=13
	-D FLASHER_LED=21
	-D FLASHER_RGB_LED=48
build_src_filter = 
	+<*>-<espflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an esp32 (depricated)
; ----------------------------------------------------------------------------------------
[env:Simple_AP]
board = esp32dev
board_build.partitions = default.csv
build_unflags =
	-std=gnu++11
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D CORE_DEBUG_LEVEL=0
	-D SIMPLE_AP
	-D SAVE_SPACE
	-D FLASHER_AP_SS=5
	-D FLASHER_AP_CLK=18
	-D FLASHER_AP_MOSI=23
	-D FLASHER_AP_MISO=19
	-D FLASHER_AP_RESET=2
	-D FLASHER_AP_POWER={13,15}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=17
	-D FLASHER_AP_RXD=16
	-D FLASHER_LED=22
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>-<ips_display.cpp>-<webflasher.cpp>
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_16_8_YELLOW_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D ARDUINO_USB_MODE=1
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
    -D ILI9341_DRIVER
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_TFT
	-D CORE_DEBUG_LEVEL=0
	-D ARDUINO_USB_MODE=0
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=17
	-D FLASHER_AP_RXD=18
	-D FLASHER_DEBUG_TXD=19
	-D FLASHER_DEBUG_RXD=20
	-D FLASHER_DEBUG_PROG=21
	-D FLASHER_LED=16
	-D HAS_RGB_LED
	-D FLASHER_RGB_LED=48
	-D ST7789_DRIVER
	-D TFT_WIDTH=172
	-D TFT_HEIGHT=320
	-D TFT_MISO=-1
	-D TFT_MOSI=13
	-D TFT_SCLK=12
	-D TFT_CS=10
	-D TFT_DC=11
	-D TFT_RST=1
	-D TFT_RGB_ORDER=TFT_BGR
	-D USE_HSPI_PORT
	-D LOAD_FONT2
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D C6_OTA_FLASHING
	-D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_16_8_LILYGO_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
monitor_dtr = 0
monitor_rts = 0
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
    ;-D ILI9341_DRIVER
lib_deps = ${env.lib_deps}
lib_extra_dirs = lib2/Arduino_GFX-1.3.7
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_TFT
	-D HAS_LILYGO_TPANEL
	-D CORE_DEBUG_LEVEL=1
        -D ARDUINO_USB_CDC_ON_BOOT=1
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
        -D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=34
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=48
	-D FLASHER_AP_RXD=47
	-D FLASHER_DEBUG_TXD=43
	-D FLASHER_DEBUG_RXD=44
	-D FLASHER_DEBUG_PROG=33
	-D FLASHER_LED=-1
	-D TFT_HEIGHT=480
	-D USE_HSPI_PORT
	-D LOAD_FONT2
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=200
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=200
	-D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_qspi ;Enable external PSRAM
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_C6_BIG_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_BLE_WRITER
	-D CORE_DEBUG_LEVEL=0
    -D ARDUINO_USB_CDC_ON_BOOT
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=13
	-D FLASHER_AP_RXD=14
	-D FLASHER_DEBUG_SWS=21
	-D FLASHER_DEBUG_TXD=15
	-D FLASHER_DEBUG_RXD=16
	-D FLASHER_DEBUG_PROG=7
	-D FLASHER_LED=38
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D C6_OTA_FLASHING
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_C6_NANO_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_BLE_WRITER
	-D CORE_DEBUG_LEVEL=0
    -D ARDUINO_USB_CDC_ON_BOOT
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=14
	-D FLASHER_AP_RXD=13
	-D FLASHER_DEBUG_TXD=12
	-D FLASHER_DEBUG_RXD=11
	-D FLASHER_DEBUG_PROG=21
	-D FLASHER_LED=38
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D C6_OTA_FLASHING
	-D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:ESP32_S3_SIMPLE_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_BLE_WRITER
	-D CORE_DEBUG_LEVEL=0
    -D ARDUINO_USB_CDC_ON_BOOT
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=41
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=2
	-D FLASHER_AP_RXD=1
	-D FLASHER_DEBUG_TXD=12
	-D FLASHER_DEBUG_RXD=11
	-D FLASHER_DEBUG_PROG=40
	-D FLASHER_LED=38
	-D HAS_RGB_LED
	-D FLASHER_RGB_LED=48
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D C6_OTA_FLASHING
	-D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB

; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Nano_TLSR]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
	-D ILI9341_DRIVER
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_TFT
	-D CORE_DEBUG_LEVEL=1
    -D ARDUINO_USB_CDC_ON_BOOT=1
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=17
	-D FLASHER_AP_RXD=18
	-D FLASHER_DEBUG_SWS=21
	-D FLASHER_DEBUG_TXD=15
	-D FLASHER_DEBUG_RXD=7
	-D FLASHER_DEBUG_PROG=6
	-D FLASHER_LED=16
	-D ST7735_NANO_TLSR
	-D ST7735_DRIVER
	-D ST7735_GREENTAB160x80
	-D TFT_INVERSION_ON
	-D TFT_WIDTH=80
	-D TFT_HEIGHT=160
	-D TFT_MISO=-1
	-D TFT_MOSI=13
	-D TFT_SCLK=12
	-D TFT_CS=10
	-D TFT_DC=11
	-D TFT_RST=1
	-D TFT_RGB_ORDER=TFT_BGR
	-D USE_HSPI_PORT
	-D LOAD_FONT2
	-D LOAD_FONT4
	-D LOAD_GLCD
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=200
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=200
	-D C6_OTA_FLASHING
        -D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Nano_TLSR_C6]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
	-D ILI9341_DRIVER
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_TFT
	-D CORE_DEBUG_LEVEL=1
    -D ARDUINO_USB_CDC_ON_BOOT=1
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=15
	-D FLASHER_AP_RXD=7
	-D FLASHER_DEBUG_SWS=21
	-D FLASHER_DEBUG_TXD=18
	-D FLASHER_DEBUG_RXD=17
	-D FLASHER_DEBUG_PROG=6
	-D FLASHER_LED=16
	-D ST7735_NANO_TLSR
	-D ST7735_DRIVER
	-D ST7735_GREENTAB160x80
	-D TFT_INVERSION_ON
	-D TFT_WIDTH=80
	-D TFT_HEIGHT=160
	-D TFT_MISO=-1
	-D TFT_MOSI=13
	-D TFT_SCLK=12
	-D TFT_CS=10
	-D TFT_DC=11
	-D TFT_RST=1
	-D TFT_RGB_ORDER=TFT_BGR
	-D USE_HSPI_PORT
	-D LOAD_FONT2
	-D LOAD_FONT4
	-D LOAD_GLCD
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=200
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=200
	-D C6_OTA_FLASHING
        -D HAS_SUBGHZ
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:BLE_ONLY_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
	-std=gnu++11
    -D ARDUINO_USB_MODE=1
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D CORE_DEBUG_LEVEL=0
	-D ARDUINO_USB_MODE=0
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=-1
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=-1
	-D FLASHER_AP_RXD=-1
	-D FLASHER_DEBUG_TXD=-1
	-D FLASHER_DEBUG_RXD=-1
	-D FLASHER_DEBUG_PROG=-1
	-D FLASHER_LED=-1
	-D HAS_RGB_LED
	-D FLASHER_RGB_LED=48
	-D BLE_ONLY
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>-<espflasher.cpp>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the PoE-AP and is work in progress right now !!!
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_PoE_AP]
platform = https://github.com/platformio/platform-espressif32.git
board=esp32dev
board_build.partitions = 16MB_partition table.csv
build_unflags =
  -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
	-std=gnu++11
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D OPENEPAPERLINK_POE_AP_PCB
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_RGB_LED
	-D BOARD_HAS_PSRAM
	-mfix-esp32-psram-cache-issue
	-D HAS_SDCARD
	-D POWER_NO_SOFT_POWER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=-1
	-D FLASHER_AP_POWER={-1} ;this board has no soft power control
	-D FLASHER_AP_TXD=15
	-D FLASHER_AP_RXD=4
	-D FLASHER_AP_TEST=-1
	-D FLASHER_LED=-1
	-D FLASHER_RGB_LED=5
	-D SD_CARD_CLK=13
	-D SD_CARD_MISO=36
	-D SD_CARD_MOSI=14
	-D SD_CARD_SS=12
build_src_filter = 
   +<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>-<webflasher.cpp>
board_build.flash_mode=qio
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 16MB Flash 8MB RAM
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Mini_AP_v4]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
monitor_dtr = 0
monitor_rts = 0
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
	-D ILI9341_DRIVER
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	-D HAS_TFT
	-D HAS_EXT_FLASHER
	-D CORE_DEBUG_LEVEL=1
    -D ARDUINO_USB_CDC_ON_BOOT=1
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D POWER_RAMPING
	-D POWER_HIGH_SIDE_DRIVER
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D HAS_BLE_WRITER
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=47
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=17
	-D FLASHER_AP_RXD=18
	-D FLASHER_DEBUG_TXD=15
	-D FLASHER_DEBUG_RXD=7
	-D FLASHER_DEBUG_PROG=21
	-D FLASHER_LED=16
	-D FLASHER_EXT_SS=40
	-D FLASHER_EXT_CLK=41
	-D FLASHER_EXT_MOSI=2
	-D FLASHER_EXT_MISO=42
	-D FLASHER_EXT_RESET=5
	-D FLASHER_EXT_POWER={6}
	-D FLASHER_EXT_TXD=38
	-D FLASHER_EXT_RXD=39
	-D FLASHER_EXT_TEST=4
	-D FLASHER_ALT_SS=-1
	-D FLASHER_ALT_CLK=-1
	-D FLASHER_ALT_MOSI=-1
	-D FLASHER_ALT_MISO=-1
	-D FLASHER_ALT_RESET=-1
	-D FLASHER_ALT_POWER={-1}
	-D FLASHER_ALT_TXD=-1
	-D FLASHER_ALT_RXD=-1
	-D FLASHER_ALT_TEST=-1
	-D HAS_RGB_LED
	-D FLASHER_RGB_LED=48
	-D ST7735_DRIVER
	-D ST7735_GREENTAB160x80
	-D TFT_INVERSION_ON
	-D TFT_WIDTH=80
	-D TFT_HEIGHT=160
	-D TFT_MISO=-1
	-D TFT_MOSI=13
	-D TFT_SCLK=12
	-D TFT_CS=10
	-D TFT_DC=11
	-D TFT_RST=1
	-D TFT_RGB_ORDER=TFT_BGR
	-D USE_HSPI_PORT
	-D LOAD_FONT2
	-D LOAD_FONT4
	-D LOAD_GLCD
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=200
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=200
	-D C6_OTA_FLASHING
        -D HAS_SUBGHZ
build_src_filter = 
	+<*>
board_build.flash_mode=qio
board_build.arduino.memory_type = qio_opi
board_build.psram_type=qspi_opi
board_upload.maximum_size = 16777216
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 16MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an ESP32-S3 4MB Flash 2MB RAM aka The Official Espressif Zigbee Gateway PCB
; ----------------------------------------------------------------------------------------
[env:ESP_THREAD_BORDER_ROUTER]
board = esp32-s3-devkitc-1
board_build.partitions = default.csv
build_unflags =
	-std=gnu++11
    -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
lib_deps =
    ${env.lib_deps}
build_flags = 
	-std=gnu++17
	${env.build_flags}
	;-D HAS_BLE_WRITER
	-D CORE_DEBUG_LEVEL=0
    -D ARDUINO_USB_CDC_ON_BOOT
	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
	-D CONFIG_SPIRAM_USE_MALLOC=1
	-D POWER_NO_SOFT_POWER
	-D BOARD_HAS_PSRAM
	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
	-D FLASHER_AP_SS=-1
	-D FLASHER_AP_CLK=-1
	-D FLASHER_AP_MOSI=-1
	-D FLASHER_AP_MISO=-1
	-D FLASHER_AP_RESET=7
	-D FLASHER_AP_POWER={-1}
	-D FLASHER_AP_TEST=-1
	-D FLASHER_AP_TXD=4
	-D FLASHER_AP_RXD=5
	-D FLASHER_DEBUG_TXD=17
	-D FLASHER_DEBUG_RXD=18
	-D FLASHER_DEBUG_PROG=8
	-D FLASHER_LED=-1
	-D MD5_ENABLED=1
	-D SERIAL_FLASHER_INTERFACE_UART=1
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D C6_OTA_FLASHING
build_src_filter = 
	+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
board_build.psram_type=qspi_opi
board_upload.maximum_size = 4194304
board_upload.maximum_ram_size = 327680
board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an SONOFF ZB Bridge-P
; ----------------------------------------------------------------------------------------
;[env:Sonoff_zb_bridge_P_AP]
;board = esp32dev
;board_build.partitions = default.csv
;build_unflags =
;	-std=gnu++11
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D CORE_DEBUG_LEVEL=0
;	-D POWER_NO_SOFT_POWER
;    -DBOARD_HAS_PSRAM
;    -mfix-esp32-psram-cache-issue
;	-D FLASHER_AP_SS=-1
;	-D FLASHER_AP_CLK=-1
;	-D FLASHER_AP_MOSI=-1
;	-D FLASHER_AP_MISO=-1
;	-D FLASHER_AP_RESET=-1
;	-D FLASHER_AP_POWER={-1}
;	-D FLASHER_AP_TEST=-1
;	-D FLASHER_AP_TXD=19
;	-D FLASHER_AP_RXD=23
;	-D FLASHER_LED=2
;build_src_filter = 
;	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
;board_build.psram_type=qspi_opi
;board_upload.maximum_size = 4194304
;board_upload.maximum_ram_size = 327680
;board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the UniRfInterface PCB with EBYTE E79 CC1352P Module
; ----------------------------------------------------------------------------------------
;[env:OpenEPaperLink_CC1352P]
;platform = https://github.com/platformio/platform-espressif32.git
;board=lolin_s2_mini
;board_build.partitions = default.csv
;build_unflags =
;	-std=gnu++11
;	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D OPENEPAPERLINK_MINI_AP_PCB
;	-D ARDUINO_USB_MODE=0
;	-D CONFIG_SPIRAM_USE_MALLOC=1
;	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
;	-D BOARD_HAS_PSRAM
;	-D POWER_NO_SOFT_POWER
;	-D FLASHER_AP_SS=-1
;	-D FLASHER_AP_CLK=-1
;	-D FLASHER_AP_MOSI=-1
;	-D FLASHER_AP_MISO=-1
;	-D FLASHER_AP_RESET=21
;  	-D FLASHER_AP_POWER={-1} ;this board has no soft power control
;  	-D FLASHER_AP_TXD=17
;  	-D FLASHER_AP_RXD=16
;  	-D FLASHER_AP_TEST=-1
;  	-D FLASHER_LED=2
;  	-D FLASHER_RGB_LED=-1
;build_src_filter = 
;	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
;board_build.psram_type=qspi_opi
;board_upload.maximum_size = 4194304
;board_upload.maximum_ram_size = 327680
;board_upload.flash_size = 4MB
; ----------------------------------------------------------------------------------------
; !!! this configuration is work in progress, do not use for now
; ----------------------------------------------------------------------------------------
;[env:OutdoorAP]
;board = esp32-s3-devkitc-1
;board_build.partitions = 32MB_partition table.csv
;build_unflags =
;	-std=gnu++11
;	-D ARDUINO_USB_MODE=1
;	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D OutdoorAP
;	-D HAS_RGB_LED
;	-D CORE_DEBUG_LEVEL=0
;	-D ARDUINO_USB_MODE=0
;	-D CONFIG_ESP32S3_SPIRAM_SUPPORT=1
;	-D CONFIG_SPIRAM_USE_MALLOC=1
;	-D POWER_NO_SOFT_POWER
;	-D BOARD_HAS_PSRAM
;	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
;	-D FLASHER_AP_SS=-1
;	-D FLASHER_AP_CLK=-1
;	-D FLASHER_AP_MOSI=-1
;	-D FLASHER_AP_MISO=-1
;	-D FLASHER_AP_RESET=47
;	-D FLASHER_AP_POWER={-1}
;	-D FLASHER_AP_TEST=-1
;	-D FLASHER_AP_TXD=17
;	-D FLASHER_AP_RXD=18
;	-D FLASHER_LED=21
;	-D FLASHER_RGB_LED=38
;build_src_filter = 
;	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
;board_build.flash_mode=opi
;board_build.arduino.memory_type = opi_opi
;board_build.psram_type=qspi_opi
;board_upload.maximum_size = 16777216
;board_upload.maximum_ram_size = 327680
;board_upload.flash_size = 32MB
#upload_flags = --no-stub
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an wemos_d1_mini32
; ----------------------------------------------------------------------------------------
;[env:Wemos_d1_mini32_AP]
;board = wemos_d1_mini32
;board_build.partitions = default.csv
;build_unflags =
;	-std=gnu++11
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D CORE_DEBUG_LEVEL=0
;	-D POWER_NO_SOFT_POWER
;	-D FLASHER_AP_SS=5
;	-D FLASHER_AP_CLK=18
;	-D FLASHER_AP_MOSI=23
;	-D FLASHER_AP_MISO=19
;	-D FLASHER_AP_RESET=14
;	-D FLASHER_AP_POWER={-1}
;	-D FLASHER_AP_TEST=-1
;	-D FLASHER_AP_TXD=16
;	-D FLASHER_AP_RXD=17
;	-D FLASHER_LED=22
;build_src_filter = 
;	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
; ----------------------------------------------------------------------------------------
; !!! this configuration expects an m5stack esp32
; ----------------------------------------------------------------------------------------
;[env:M5Stack_Core_ONE_AP]
;platform = espressif32
;board = m5stack-core-esp32
;board_build.partitions = esp32_sdcard.csv
;build_unflags =
;	-std=gnu++11
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D CORE_DEBUG_LEVEL=0
;	-D POWER_NO_SOFT_POWER
;	-D HAS_SDCARD
;	-D USE_SOFTSPI
;	-D SD_CARD_SS=4
;	-D SD_CARD_CLK=18
;	-D SD_CARD_MISO=19
;	-D SD_CARD_MOSI=23
;	-D FLASHER_AP_SS=5
;	-D FLASHER_AP_CLK=36
;	-D FLASHER_AP_MOSI=26
;	-D FLASHER_AP_MISO=35
;	-D FLASHER_AP_RESET=2
;	-D FLASHER_AP_POWER={-1}
;	-D FLASHER_AP_TEST=-1
;	-D FLASHER_AP_TXD=16
;	-D FLASHER_AP_RXD=17
;	-D FLASHER_LED=-1
;	-D FLASH_TIMEOUT=10
;	-D USER_SETUP_LOADED
;	-D DISABLE_ALL_LIBRARY_WARNINGS
;	-D ILI9341_DRIVER
;	-D SMOOTH_FONT
;build_src_filter = 
;	+<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
; ----------------------------------------------------------------------------------------
; !!! this configuration expects the Nano_C6
; ----------------------------------------------------------------------------------------
;[env:OpenEPaperLink_Nano_C6]
;platform = https://github.com/platformio/platform-espressif32.git
;board=lolin_s2_mini
;board_build.partitions = default.csv
;build_unflags =
;	-std=gnu++11
;	-D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
;build_flags = 
;	-std=gnu++17
;	${env.build_flags}
;	-D OPENEPAPERLINK_NANO_AP_PCB
;	-D ARDUINO_USB_MODE=0
;	-D CONFIG_SPIRAM_USE_MALLOC=1
;	-D CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
;	-D POWER_NO_SOFT_POWER
;	-D BOARD_HAS_PSRAM
;	-D FLASHER_AP_SS=-1
;	-D FLASHER_AP_CLK=-1
;	-D FLASHER_AP_MOSI=-1
;	-D FLASHER_AP_MISO=-1
;	-D FLASHER_AP_RESET=39
;	-D FLASHER_AP_POWER={-1}
;	-D FLASHER_AP_TEST=-1
;	-D FLASHER_AP_TXD=35
;	-D FLASHER_AP_RXD=33
; 	-D FLASHER_LED=15
;	-D FLASHER_RGB_LED=-1
;	-D MD5_ENABLED=1
;	-D SERIAL_FLASHER_INTERFACE_UART=1
;	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
;	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
;build_src_filter = 
;   +<*>-<usbflasher.cpp>-<swd.cpp>-<espflasher.cpp>
;board_build.psram_type=qspi_opi
;board_upload.maximum_size = 4194304
;board_upload.maximum_ram_size = 327680
;board_upload.flash_size = 4MB
