; 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]
default_envs = ttgo-t-beam-v1_2

[env]
framework = arduino
monitor_speed = 115200
lib_ldf_mode = deep+

[env:esp32]
extends = env
platform = espressif32 @ 6.7.0
board_build.partitions = huge_app.csv
monitor_filters = esp32_exception_decoder
board_build.embed_files = 
	data_embed/index.html.gz
	data_embed/style.css.gz
	data_embed/script.js.gz
	data_embed/bootstrap.css.gz
	data_embed/bootstrap.js.gz
	data_embed/favicon.png.gz
extra_scripts = 
	pre:tools/compress.py
debug_tool = esp-prog

[env:nrf52]
extends = env
platform = nordicnrf52
upload_protocol = nrfutil

[common]
build_flags =
	-Werror -Wall
	-DRADIOLIB_EXCLUDE_CC1101=1
	-DRADIOLIB_EXCLUDE_NRF24=1
	-DRADIOLIB_EXCLUDE_RF69=1
	-DRADIOLIB_EXCLUDE_SX1231=1
	-DRADIOLIB_EXCLUDE_SX1233=1
	-DRADIOLIB_EXCLUDE_SI443X=1
	-DRADIOLIB_EXCLUDE_RFM2X=1
	-DRADIOLIB_EXCLUDE_AFSK=1
	-DRADIOLIB_EXCLUDE_BELL=1
	-DRADIOLIB_EXCLUDE_HELLSCHREIBER=1
	-DRADIOLIB_EXCLUDE_MORSE=1
	-DRADIOLIB_EXCLUDE_RTTY=1
	-DRADIOLIB_EXCLUDE_SSTV=1
	-DRADIOLIB_EXCLUDE_AX25=1
	-DRADIOLIB_EXCLUDE_DIRECT_RECEIVE=1
	-DRADIOLIB_EXCLUDE_BELL=1
	-DRADIOLIB_EXCLUDE_PAGER=1
	-DRADIOLIB_EXCLUDE_FSK4=1
	-DRADIOLIB_EXCLUDE_APRS=1
	-DRADIOLIB_EXCLUDE_LORAWAN=1
lib_deps =
	jgromes/RadioLib @ 6.6.0
	mikalhart/TinyGPSPlus @ 1.0.3
	paulstoffregen/Time @ 1.6.1
	shaggydog/OneButton @ 1.5.0
	bblanchon/ArduinoJson @ 6.21.3
	h2zero/NimBLE-Arduino @ 1.4.1
	peterus/esp-logger @ 1.0.0
	adafruit/Adafruit BusIO @ 1.16.1
	adafruit/Adafruit Unified Sensor @ 1.1.14
	adafruit/Adafruit BME280 Library @ 2.2.4
	adafruit/Adafruit BMP280 Library @ 2.6.8
	adafruit/Adafruit BME680 Library @ 2.0.4
	mathieucarbou/ESPAsyncWebServer @ 3.2.3
	mathieucarbou/AsyncTCP @ 3.2.5
display_libs =
	adafruit/Adafruit GFX Library @ 1.11.9
	adafruit/Adafruit SSD1306 @ 2.5.10


[env:ttgo-t-beam-v1_2]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_2
	-DHAS_SX1278
	-DHAS_AXP2101
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10

[env:ttgo-t-beam-v1_2_915]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_2_915
	-DHAS_SX1276
	-DHAS_AXP2101
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-beam-v1_2_SX1262]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_2_SX1262
	-DHAS_SX1262
	-DHAS_AXP2101
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-beam-v1]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_0
	-DHAS_SX1278
	-DHAS_AXP192
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10

[env:ttgo-t-beam-v1_915]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_0_915
	-DHAS_SX1276
	-DHAS_AXP192
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-beam-v1_SX1268]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V1_0_SX1268
	-DHAS_SX1268
	-DHAS_AXP192
	-DHAS_BT_CLASSIC
	-DHAS_GPS_CTRL
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-beam-v0_7]
extends = env:esp32
board = ttgo-t-beam
build_flags =
	${common.build_flags}
	-DTTGO_T_Beam_V0_7
	-DHAS_SX1278
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-lora32-v2_1_GPS]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DTTGO_T_LORA32_V2_1_GPS
	-DHAS_SX1278
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ttgo-t-lora32-v2_1_GPS_915]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DTTGO_T_LORA32_V2_1_GPS_915
	-DHAS_SX1276
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo-t-lora32-v2_1_TNC]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DTTGO_T_LORA32_V2_1_TNC
	-DHAS_SX1278
	-DHAS_BT_CLASSIC
	-DHAS_NO_GPS
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ttgo-t-lora32-v2_1_TNC_915]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DTTGO_T_LORA32_V2_1_TNC_915
	-DHAS_SX1276
	-DHAS_BT_CLASSIC
	-DHAS_NO_GPS
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:heltec_wifi_lora_32_v3_GPS]
extends = env:esp32
board = heltec_wifi_lora_32_V3
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DHELTEC_V3_GPS
	-DHAS_SX1262
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}

[env:heltec_wifi_lora_32_v3_TNC]
extends = env:esp32
board = heltec_wifi_lora_32_V3
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DHELTEC_V3_TNC
	-DHAS_SX1262
	-DHAS_NO_GPS
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}


[env:heltec_wireless_tracker]
extends = env:esp32
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DHELTEC_WIRELESS_TRACKER
	-DHAS_SX1262
	-DGPS_BAUDRATE=115200
	-DHAS_GPS_CTRL
	-DHAS_TFT
    -D USER_SETUP_LOADED
	-D TFT_WIDTH=80
	-D TFT_HEIGHT=160
    -D ST7735_DRIVER
    -D ST7735_GREENTAB160x80
    -D TFT_RGB_ORDER=TFT_BGR
    -D TFT_MOSI=42
    -D TFT_SCLK=41
    -D TFT_CS=38
    -D TFT_DC=40
    -D TFT_RST=39
	-D TFT_BL=21
	-D TFT_BACKLIGHT_ON=1
    -D TOUCH_CS=-1
    -D LOAD_GLCD
    -D LOAD_FONT2
    -D LOAD_FONT4
    -D LOAD_FONT6
    -D LOAD_FONT7
    -D LOAD_FONT8
    -D SPI_FREQUENCY=27000000
    -D USE_HSPI_PORT
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	bodmer/TFT_eSPI @ 2.5.43


[env:ttgo_t_beam_s3_SUPREME_v3]
extends = env:esp32
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
    -DTTGO_T_Beam_S3_SUPREME_V3
    -DBOARD_HAS_PSRAM
	-DHAS_SX1262
	-DHAS_GPS_CTRL
	-DHAS_AXP2101
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
  	${common.lib_deps}
	${common.display_libs}
  	lewisxhe/XPowersLib @ 0.2.4
	adafruit/Adafruit SH110X @ 2.1.10


[env:ttgo_t_deck_GPS]
extends = env
platform = espressif32 @ 6.3.1
board_build.partitions = huge_app.csv
monitor_filters = esp32_exception_decoder
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
board_build.embed_files =
	data_embed/index.html.gz
	data_embed/style.css.gz
	data_embed/script.js.gz
	data_embed/bootstrap.css.gz
	data_embed/bootstrap.js.gz
	data_embed/favicon.png.gz
extra_scripts =
	pre:tools/compress.py
debug_tool = esp-prog
build_flags =
	${common.build_flags}
	-DTTGO_T_DECK_GPS
	-DBOARD_HAS_PSRAM
	-DHAS_SX1262
	-DHAS_TFT
    -DUSER_SETUP_LOADED
    -DST7789_DRIVER
	-DTFT_WIDTH=240
	-DTFT_HEIGHT=320
    -DTFT_RGB_ORDER=TFT_BGR
    -DTFT_INVERSION_ON
    -DTFT_MISO=38
    -DTFT_MOSI=41
    -DTFT_SCLK=40
    -DTFT_CS=12
    -DTFT_DC=11
    -DTFT_RST=-1
	-DTFT_BUSY=-1
	-DTFT_BL=42
	-DTFT_BACKLIGHT_ON=1
    -DTOUCH_CS=-1
    -DLOAD_GLCD
    -DLOAD_FONT2
    -DLOAD_FONT4
    -DLOAD_FONT6
    -DLOAD_FONT7
    -DLOAD_FONT8
    -DSPI_FREQUENCY=40000000
    -DSPI_READ_FREQUENCY=16000000
	-DARDUINO_USB_MODE=1
	-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	bodmer/TFT_eSPI @ 2.5.43

[env:ttgo_t_deck_plus]
extends = env
platform = espressif32 @ 6.3.1
board_build.partitions = huge_app.csv
monitor_filters = esp32_exception_decoder
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
board_build.embed_files = 
	data_embed/index.html.gz
	data_embed/style.css.gz
	data_embed/script.js.gz
	data_embed/bootstrap.css.gz
	data_embed/bootstrap.js.gz
	data_embed/favicon.png.gz
extra_scripts =
	pre:tools/compress.py
debug_tool = esp-prog
build_flags =
	${common.build_flags}
	-DTTGO_T_DECK_PLUS
	-DBOARD_HAS_PSRAM
	-DHAS_SX1262
	-DGPS_BAUDRATE=38400
	-DHAS_TFT
    -DUSER_SETUP_LOADED
    -DST7789_DRIVER
	-DTFT_WIDTH=240
	-DTFT_HEIGHT=320
    -DTFT_RGB_ORDER=TFT_BGR
    -DTFT_INVERSION_ON
    -DTFT_MISO=38
    -DTFT_MOSI=41
    -DTFT_SCLK=40
    -DTFT_CS=12
    -DTFT_DC=11
    -DTFT_RST=-1
	-DTFT_BUSY=-1
	-DTFT_BL=42
	-DTFT_BACKLIGHT_ON=1
    -DTOUCH_CS=-1
    -DLOAD_GLCD
    -DLOAD_FONT2
    -DLOAD_FONT4
    -DLOAD_FONT6
    -DLOAD_FONT7
    -DLOAD_FONT8
    -DSPI_FREQUENCY=40000000
    -DSPI_READ_FREQUENCY=16000000
	-DARDUINO_USB_MODE=1
	-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	bodmer/TFT_eSPI @ 2.5.43


[env:ESP32_DIY_LoRa_GPS]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
	-DESP32_DIY_LoRa_GPS
	-DHAS_SX1278
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ESP32_DIY_LoRa_GPS_915]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
	-DESP32_DIY_LoRa_GPS_915
	-DHAS_SX1276
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:ESP32S3_DIY_LoRa_GPS]
extends = env:esp32
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DESP32S3_DIY_LoRa_GPS
	-DHAS_SX1278
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ESP32S3_DIY_LoRa_GPS_915]
extends = env:esp32
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DESP32S3_DIY_LoRa_GPS_915
	-DHAS_SX1276
	-DARDUINO_USB_MODE=1
    -DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:ESP32_DIY_1W_LoRa_GPS]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
	-DESP32_DIY_1W_LoRa_GPS
	-DHAS_SX1268
	-DHAS_1W_LORA
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ESP32_DIY_1W_LoRa_GPS_915]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
	-DESP32_DIY_1W_LoRa_GPS_915
	-DHAS_SX1262
	-DHAS_1W_LORA
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:ESP32_DIY_1W_LoRa_GPS_LLCC68]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
 	-DESP32_DIY_1W_LoRa_GPS_LLCC68
 	-DHAS_LLCC68
 	-DHAS_1W_LORA
 	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:OE5HWN_MeshCom]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
	-DOE5HWN_MeshCom
	-DHAS_SX1268
	-DHAS_1W_LORA
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:Wemos_ESP32_Bat_LoRa_GPS]
extends = env:esp32
board = esp32dev
build_flags =
	${common.build_flags}
 	-DWEMOS_ESP32_Bat_LoRa_GPS
 	-DHAS_SX1278
 	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10


[env:esp32_c3_DIY_LoRa_GPS]
extends = env:esp32
board = esp32-c3-devkitm-1
board_build.mcu = esp32c3
build_flags =
	${common.build_flags}
	-DESP32_C3_DIY_LoRa_GPS
	-DHAS_SX1278
	-DARDUINO_USB_MODE=1
	-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:esp32_c3_DIY_LoRa_GPS_915]
extends = env:esp32
board = esp32-c3-devkitm-1
board_build.mcu = esp32c3
build_flags =
	${common.build_flags}
	-DESP32_C3_DIY_LoRa_GPS_915
	-DHAS_SX1276
	-DARDUINO_USB_MODE=1
	-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	${common.display_libs}
	adafruit/Adafruit SH110X @ 2.1.10

[env:heltec-lora32-v2_GPS]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DHELTEC_V2_GPS
	-DHAS_SX1278
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}

[env:heltec-lora32-v2_GPS_915]
extends = env:esp32
board = ttgo-lora32-v21
build_flags =
	${common.build_flags}
	-DHELTEC_V2_GPS_915
	-DHAS_SX1276
	-DHAS_BT_CLASSIC
lib_deps =
	${common.lib_deps}
	${common.display_libs}

[env:heltec_ht-ct62_GPS]
extends = env:esp32
board = heltec_wireless_stick_lite
board_build.mcu = esp32c3
build_flags =
	${common.build_flags}
	-DHELTEC_HTCT62_GPS
	-DHAS_SX1262
lib_deps =
	${common.lib_deps}
	${common.display_libs}

[env:QRPLabs_LightTracker_Plus_1_0]
extends = env:esp32
board = esp32-s3-devkitc-1
board_build.mcu = esp32s3
build_flags =
	${common.build_flags}
	-DLIGHTTRACKER_PLUS_1_0
	-DHAS_SX1268
	-DHAS_1W_LORA
	-DARDUINO_USB_MODE=1
	-DARDUINO_USB_CDC_ON_BOOT=1
lib_deps =
	${common.lib_deps}
	adafruit/Adafruit SHTC3 Library @ 1.0.1