; 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=
	m5stack-atom
	m5stack-atom-canunit
	m5stickc-atom-canunit
	nodemcu-homberger
extra_configs=
	lib/*task*/platformio.ini

[basedeps]
lib_deps = 
    ttlappalainen_NMEA2000=https://github.com/wellenvogel/NMEA2000.git#20251126
	ttlappalainen/NMEA0183 @ 1.10.1
	ArduinoJson @ 6.18.5
	AsyncTCP-esphome @ 2.0.1
	ottowinter/ESPAsyncWebServer-esphome@2.0.1
	FS
	Preferences
	ESPmDNS
	WiFi
	Update

[devdeps]
lib_deps=
	ttlappalainen_NMEA2000=symlink://../NMEA2000
	ttlappalainen/NMEA0183 @ 1.10.1
	ArduinoJson @ 6.18.5
	AsyncTCP-esphome @ 2.0.1
	ottowinter/ESPAsyncWebServer-esphome@2.0.1
	FS
	Preferences
	ESPmDNS
	WiFi
	Update
[env]
platform = espressif32 @ 6.8.1
framework = arduino
;platform_packages=
;	framework-arduinoespressif32 @ 3.20017.0
;	framework-espidf @ 3.50101.0
lib_deps = 
	${basedeps.lib_deps}
	fastled/FastLED @ 3.6.0


board_build.embed_files = 
	lib/generated/index.html.gz
	lib/generated/index.js.gz
	lib/generated/index.css.gz
	lib/generated/config.json.gz
	lib/generated/xdrconfig.json.gz
	lib/generated/md5.js.gz
board_build.partitions = partitions_custom.csv	
extra_scripts = 
	pre:extra_script.py
	post:post.py
lib_ldf_mode = off	
#lib_ldf_mode = chain+
monitor_speed = 115200
build_flags = 
	-D PIO_ENV_BUILD=$PIOENV

[sensors]
; collect the libraries for sensors here
lib_deps =
	Wire
	SPI
	adafruit/Adafruit BME280 Library @ 2.2.2
	adafruit/Adafruit BMP280 Library@^2.6.8
	adafruit/Adafruit BusIO @ 1.14.5
	adafruit/Adafruit Unified Sensor @ 1.1.13

[env:m5stack-atom-dev]
board = m5stack-atom
lib_deps = 
	${devdeps.lib_deps}
	fastled/FastLED @ 3.6.0
	
build_flags = 
	-D BOARD_M5ATOM
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool
[env:m5stack-atom]
board = m5stack-atom
lib_deps = ${env.lib_deps}
build_flags = 
	-D BOARD_M5ATOM
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atom-generic]
extends = sensors
board = m5stack-atom
lib_deps = 
	${env.lib_deps}
	${sensors.lib_deps}
build_flags = 
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atoms3]
board = m5stack-atoms3
lib_deps = ${env.lib_deps}
build_flags = 
        -D BOARD_M5ATOMS3
        ${env.build_flags}
upload_port = /dev/esp32s3
upload_protocol = esptool

[env:m5stack-atoms3-generic]
extends = sensors
board = m5stack-atoms3
lib_deps = 
	${env.lib_deps}
	${sensors.lib_deps}
build_flags = 
        ${env.build_flags}
upload_port = /dev/esp32s3
upload_protocol = esptool

[env:m5stack-atom-canunit]
board = m5stack-atom
lib_deps = ${env.lib_deps}
build_flags = 
	-D BOARD_M5ATOM_CANUNIT
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atoms3-canunit]
board = m5stack-atoms3
lib_deps = ${env.lib_deps}
build_flags = 
        -D BOARD_M5ATOMS3_CANUNIT
        ${env.build_flags}
upload_port = /dev/esp32s3
upload_protocol = esptool


[env:m5stack-atom-rs232-canunit]
board = m5stack-atom
lib_deps = ${env.lib_deps}
build_flags = 
        -D BOARD_M5ATOM_RS232_CANUNIT
        ${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stack-atom-rs485-canunit]
board = m5stack-atom
lib_deps = ${env.lib_deps}
build_flags = 
        -D BOARD_M5ATOM_RS485_CANUNIT
        ${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool


[env:m5stickc-atom-canunit]
board = m5stick-c
lib_deps = ${env.lib_deps}
build_flags = 
	-D BOARD_M5STICK_CANUNIT -D HAS_RTC -D HAS_M5LCD
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:m5stickc-atom-generic]
extends = sensors
board = m5stick-c
lib_deps = 
	${env.lib_deps}
	${sensors.lib_deps}
build_flags = 
	-D BOARD_M5STICK -D HAS_RTC -D HAS_M5LCD
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:nodemcu-homberger]
board = nodemcu-32s
lib_deps = ${env.lib_deps}
build_flags = 
	-D BOARD_HOMBERGER
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:nodemcu-generic]
extends = sensors
board = nodemcu-32s
lib_deps = 
	${env.lib_deps}
	${sensors.lib_deps}
build_flags = 
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool

[env:s3devkitm-generic]
extends = sensors
board = esp32-s3-devkitm-1
lib_deps = 
	${env.lib_deps}
	${sensors.lib_deps}
build_flags = 
	${env.build_flags}
upload_port = /dev/esp32
upload_protocol = esptool
