[env]
platform = espressif32
framework = arduino
lib_deps = 
platform_packages = 
board_build.filesystem = littlefs
monitor_filters = esp32_exception_decoder
monitor_speed = 115200
board_build.f_cpu = 240000000L
build_flags =
	-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
	-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
	-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
	-D SERIAL_FLASHER_INTERFACE_UART
	-D SERIAL_FLASHER_DEBUG_TRACE

upload_port = COM11
monitor_port = COM11

[env:ESP32_S3_16_8_YELLOW_AP]
board = esp32-s3-devkitc-1
board_build.partitions = large_spiffs_16MB.csv
build_unflags =
  -D ARDUINO_USB_MODE=1
  -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
  -D ILI9341_DRIVER
build_flags = 
	${env.build_flags}
	-D YELLOW_IPS_AP
	-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=14
	-D ST7789_DRIVER
	-D TFT_WIDTH=170
	-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
build_src_filter = 
   +<*>-<usbflasher.cpp>-<swd.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 Nano_C6
; 
; ----------------------------------------------------------------------------------------
[env:OpenEPaperLink_Nano_C6_this]
platform = https://github.com/platformio/platform-espressif32.git
board=lolin_s2_mini
board_build.partitions = default.csv
build_unflags =
  -D CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
build_flags = 
	${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_DEBUG_TXD=19
	;-D FLASHER_DEBUG_RXD=20
	;-D FLASHER_DEBUG_PROG=21
  	-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