;
; PlatformIO Project Configuration File
;
; Please make sure to read documentation with examples first
; http://docs.platformio.org/en/stable/projectconf.html
;

; *********************************************************************;
; You can uncomment or add here Your favorite environment you want to work on at the moment
; (uncomment only one !)
; *********************************************************************;

[platformio]
;env_default = esp32dev
;env_default = dev_ESP8266_4096
;env_default = normal_ESP8266_1024
;env_default = normal_ESP8266_4096
; ..etc



;minimal version for esps with 512K or less flash (only has minimal plugin set)
; [env:mini_512]
; platform                  = ${common.platform}
; framework                 = ${common.framework}
; board = esp01
; upload_speed              = ${common.upload_speed}
; build_flags               = !echo -Wl,-Tesp8266.flash.512k64.ld -D BUILD_GIT=\'\"$(git describe)\"\'
; ; upload_port = /dev/ttyUSB0

; add these:
; -Werror -Wall -Wextra -pedantic -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op
;                    -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-promo -Wstrict-null-sentinel
;                    -Wstrict-overflow=5 -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option
; thanks @chouffe103
[compiler_warnings]
build_flags =
  -Wall -Wno-parentheses -fdiagnostics-show-option

; *********************************************************************

; **** Definition cheat sheet:
; board_build.flash_mode in terms of performance: QIO > QOUT > DIO > DOUT
; for lib_ldf_mode, see http://docs.platformio.org/en/latest/librarymanager/ldf.html;ldf

; **** Frequently used build flags:
; Use custom.h file to override default settings for ESPeasy: -D USE_CUSTOM_H
; Set VCC mode to measure Vcc of ESP chip :                   -D FEATURE_ADC_VCC=true

[core_2_3_0]
platform                  = espressif8266@1.5.0

[core_2_4_0]
platform                  = espressif8266@1.6.0

[core_2_4_1]
platform                  = espressif8266@1.7.3

[core_2_4_2]
platform                  = espressif8266@1.8.0

[core_staged]
platform                  = https://github.com/platformio/platform-espressif8266.git#feature/stage


[core_esp32_0_12_0]
platform                  = espressif32@0.12.0
lib_deps                  = "ESP32WebServer"

[core_esp32_1_2_0]
platform                  = espressif32@1.2.0

[core_esp32_1_3_0]
platform                  = espressif32@1.3.0

[core_esp32_1_4_0]
platform                  = espressif32@1.4.0

[core_esp32_stage]
platform                  = https://github.com/platformio/platform-espressif32.git#feature/stage

[core_esp32]
platform                  = ${core_esp32_1_4_0.platform}
build_unflags             = -Wall
build_flags               = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
lib_ignore                = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, SerialSensors, SDM
lib_deps                  = ""
monitor_speed             = 115200




; Build Flags:
;  -DUSE_CONFIG_OVERRIDE
; lwIP 1.4 (Default)
;  -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
;  -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwitdh
;  -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; VTABLES in Flash (default)
;  -DVTABLES_IN_FLASH
; VTABLES in Heap
;  -DVTABLES_IN_DRAM
; VTABLES in IRAM
;  -DVTABLES_IN_IRAM
; NO_EXTRA_4K_HEAP - this forces the default NONOS-SDK user's heap location
;     Default currently overlaps cont stack (Arduino) with sys stack (System)
;     to save up-to 4 kB of heap. (starting core_2.4.2)
; ESP8266_DISABLE_EXTRA4K  - Calls disable_extra4k_at_link_time() from setup
;                            to force the linker keep user's stack in user ram.
; CONT_STACKSIZE to set the 'cont' (Arduino) stack size. Default = 4096

[common]
board_build.f_cpu         = 80000000L
build_unflags             =
build_flags               = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
                   -D NDEBUG
                   -lstdc++ -lsupc++
                   -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
                   -DVTABLES_IN_FLASH


lib_deps                  = ""
lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266
lib_ldf_mode              = chain
lib_archive               = false
upload_speed              = 460800
framework                 = arduino
board                     = esp12e
platform                  = ${core_2_4_2.platform}
monitor_speed             = 115200

[normal]
platform                  = ${common.platform}
build_flags               =

[testing]
platform                  = ${core_2_4_2.platform}
build_flags               = -DPLUGIN_BUILD_TESTING

[dev]
platform                  = ${core_2_4_2.platform}
build_flags               = -DPLUGIN_BUILD_DEV

[ir]
lib_ignore                = ESP32_ping, ESP32WebServer


[esp8266_1M]
board_build.flash_mode    = dout
board_build.f_cpu         = ${common.board_build.f_cpu}
board_upload.maximum_size = 786432
build_unflags             = ${common.build_unflags}
build_flags               = ${common.build_flags} -Wl,-Tesp8266.flash.1m128.ld

[esp8285_1M]
board                     = esp8285
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} -DESP8285

[espWroom2M]
board_build.flash_mode    = dout
board_build.f_cpu         = ${common.board_build.f_cpu}
board                     = esp_wroom_02
build_unflags             = ${common.build_unflags}
build_flags               = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld

[esp8266_2M]
board_build.flash_mode    = dio
board_build.f_cpu         = ${common.board_build.f_cpu}
build_unflags             = ${common.build_unflags}
build_flags               = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld

[esp8266_4M]
board_build.flash_mode    = dio
board_upload.maximum_size = 900000
board_build.f_cpu         = ${common.board_build.f_cpu}
build_unflags             = ${common.build_unflags}
build_flags               = ${common.build_flags} -Wl,-Tesp8266.flash.4m1m.ld


[Sonoff]
board                     = esp01_1m
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
build_unflags             = ${common.build_unflags}
build_flags               = ${common.build_flags} -Wl,-Tesp8266.flash.1m128.ld
platform                  = ${core_2_4_1.platform}

[Sonoff_4M]
board                     = esp12e
board_upload.maximum_size = ${esp8266_4M.board_upload.maximum_size}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags}
platform                  = ${common.platform}


[Sonoff_8285]
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
board_build.flash_mode    = ${esp8285_1M.board_build.flash_mode}
board_build.f_cpu         = ${esp8285_1M.board_build.f_cpu}
board                     = ${esp8285_1M.board}
build_unflags             = ${esp8285_1M.build_unflags}
build_flags               = ${esp8285_1M.build_flags}
platform                  = ${core_2_4_1.platform}

;;; ESP32 pre-alpha test build ; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;;
; Very limited build for ESP32, to start testing regular building for ESP32.             ;
; Will probably not work, not tested and guaranteed to take a few hours time of some     ;
; still trying to build the version without reading this warning.                        ;
; *********************************************************************
[env:esp-wrover-kit_test_1M8_partition]
platform                  = ${core_esp32.platform}
board                     = esp-wrover-kit
build_unflags             = ${core_esp32.build_unflags}
build_flags               = ${core_esp32.build_flags}  -DPLUGIN_SET_TEST_ESP32
lib_deps                  = ${core_esp32.lib_deps}
lib_ignore                = ${core_esp32.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
upload_protocol           = ftdi
debug_tool                = ftdi
monitor_speed             = ${common.monitor_speed}
board_build.partitions    = esp32_partition_app1810k_spiffs316k.csv
board_upload.maximum_size = 1900544
debug_extra_cmds          = break Misc.ino:3011


[env:esp32dev]
platform                  = ${core_esp32.platform}
board                     = esp32dev
build_unflags             = ${core_esp32.build_unflags}
build_flags               = ${core_esp32.build_flags}  -DPLUGIN_SET_GENERIC_ESP32
lib_deps                  = ${core_esp32.lib_deps}
lib_ignore                = ${core_esp32.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}

[env:esp32test_1M8_partition]
platform                  = ${core_esp32.platform}
board                     = esp32dev
build_unflags             = ${core_esp32.build_unflags}
build_flags               = ${core_esp32.build_flags}  -DPLUGIN_SET_TEST_ESP32
lib_deps                  = ${core_esp32.lib_deps}
lib_ignore                = ${core_esp32.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.partitions    = esp32_partition_app1810k_spiffs316k.csv
board_upload.maximum_size = 1900544


;;; NORMAL (STABLE) ; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;
; normal version with stable plugins                                                     ;
; *********************************************************************

; NORMAL: 1024k version --------------------------
[env:normal_ESP8266_1024]
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${normal.build_flags}

[env:normal_core_241_ESP8266_1024]
platform                  = ${core_2_4_1.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${normal.build_flags}

; NORMAL: 1024k for esp8285 ----------------------
[env:normal_ESP8285_1024]
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${esp8285_1M.board}
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8285_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8285_1M.board_build.flash_mode}
build_unflags             = ${esp8285_1M.build_unflags}
build_flags               = ${esp8285_1M.build_flags} ${normal.build_flags}

; NORMAL: 2048k version --------------------------
[env:normal_WROOM02_2048]
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${espWroom2M.board}
board_build.f_cpu         = ${espWroom2M.board_build.f_cpu}
board_build.flash_mode    = ${espWroom2M.board_build.flash_mode}
build_unflags             = ${espWroom2M.build_unflags}
build_flags               = ${espWroom2M.build_flags} ${normal.build_flags}

; NORMAL: 4096k version --------------------------
[env:normal_ESP8266_4096]
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${normal.build_flags}

[env:normal_core_241_ESP8266_4096]
platform                  = ${core_2_4_1.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${normal.build_flags}


; NORMAL IR: 4096k version --------------------------
; Build including IR libraries
[env:normal_IR_ESP8266_4096]
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${ir.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${normal.build_flags} -DPLUGIN_BUILD_NORMAL_IR


;;; TESTING ; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****
; additional plugins (and dependend code) that are in test-stadium                       ;
; *********************************************************************

; TEST: 1024k version ----------------------------
[env:test_ESP8266_1024]
platform                  = ${testing.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board                     = ${common.board}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${testing.build_flags}

; TEST: 1024k for esp8285 ------------------------
[env:test_ESP8285_1024]
platform                  = ${testing.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8285_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8285_1M.board_build.flash_mode}
board                     = ${esp8285_1M.board}
build_unflags             = ${esp8285_1M.build_unflags}
build_flags               = ${esp8285_1M.build_flags} ${testing.build_flags}

; TEST: 2048k version ----------------------------
[env:test_WROOM02_2048]
platform                  = ${testing.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.f_cpu         = ${espWroom2M.board_build.f_cpu}
board_build.flash_mode    = ${espWroom2M.board_build.flash_mode}
board                     = ${espWroom2M.board}
build_unflags             = ${espWroom2M.build_unflags}
build_flags               = ${espWroom2M.build_flags} ${testing.build_flags}

; TEST: 4096k version ----------------------------
[env:test_ESP8266_4096]
platform                  = ${testing.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
board                     = ${common.board}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${testing.build_flags}

; TEST: 4096k version + FEATURE_ADC_VCC ----------
[env:test_ESP8266_4096_VCC]
platform                  = ${testing.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
board                     = ${common.board}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${testing.build_flags} -D FEATURE_ADC_VCC=true



;;; DEV ; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;
; additional plugins (and dependend code) that is in development (probably broken or incomplete)
; *********************************************************************

; DEV : 1024k version ----------------------------
[env:dev_ESP8266_1024]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
board                     = ${common.board}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${dev.build_flags}

; DEV: 1024k for esp8285 -------------------------
[env:dev_ESP8285_1024]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8285_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8285_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8285_1M.board_build.flash_mode}
board                     = ${esp8285_1M.board}
build_unflags             = ${esp8285_1M.build_unflags}
build_flags               = ${esp8285_1M.build_flags} ${dev.build_flags}

; DEV: 2048k version -----------------------------
[env:dev_WROOM02_2048]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.f_cpu         = ${espWroom2M.board_build.f_cpu}
board_build.flash_mode    = ${espWroom2M.board_build.flash_mode}
board                     = ${espWroom2M.board}
build_unflags             = ${espWroom2M.build_unflags}
build_flags               = ${espWroom2M.build_flags} ${dev.build_flags}

; DEV : 4096k version ----------------------------
[env:dev_ESP8266_4096]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
board                     = ${common.board}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_build.f_cpu         = ${esp8266_4M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_4M.board_build.flash_mode}
build_unflags             = ${esp8266_4M.build_unflags}
build_flags               = ${esp8266_4M.build_flags} ${dev.build_flags}



;;; DEV + PUYA ; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;
; special patched version for PUYA flash chips, see issue ;650 at Github                 ;
; *********************************************************************

; DEV+PUYA : 1024k version -----------------------
[env:dev_ESP8266PUYA_1024]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
board                     = ${common.board}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${dev.build_flags} -D FLASH_QUIRK_WRITE_0_TO_1

; DEV+PUYA : 1024k version + FEATURE_ADC_VCC -----
[env:dev_ESP8266PUYA_1024_VCC]
platform                  = ${dev.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
board                     = ${common.board}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} ${dev.build_flags} -D FLASH_QUIRK_WRITE_0_TO_1 -D FEATURE_ADC_VCC=true




;;; HARDWARE SPECIFIC VERSIONS ; ****; ****; ****; ****; ****; ****; ****; ****; ****;;;;;
; versions specially designed to fit, and contents only needed plugins for each hardware ;
; *********************************************************************

; ITEAD Products ; ****; ****; ****; ****; ****;;

; ITEAD / SONOFF BASIC version ------------------
;[env:hard_SONOFF_BASIC]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${Sonoff.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
;board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
;board                     = ${Sonoff.board}
;build_unflags             = ${Sonoff.build_unflags}
;build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_BASIC


; ITEAD / SONOFF TH10/TH16 version -------------------
;[env:hard_SONOFF_TH1x]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${Sonoff.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
;board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
;board                     = ${Sonoff.board}
;build_unflags             = ${Sonoff.build_unflags}
;build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TH1x

; ITEAD / SONOFF POW version --------------------
; Sonoff Pow (ESP8266 - HLW8012)
; GPIO00 Button
; GPIO05 HLW8012 Sel output
; GPIO12 Red Led and Relay (0 = Off, 1 = On)
; GPIO13 HLW8012 CF1 voltage / current
; GPIO14 HLW8012 CF power
; GPIO15 Blue Led (0 = On, 1 = Off)
[env:hard_SONOFF_POW]
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
framework                 = ${common.framework}
platform                  = ${Sonoff.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
board                     = ${Sonoff.board}
build_unflags             = ${Sonoff.build_unflags}
build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW

; Sonoff Pow R2 (ESP8266 4M flash - CSE7766)
; GPIO00 Button
; GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor
; GPIO03 Serial TXD
; GPIO12 Red Led and Relay (0 = Off, 1 = On)
; GPIO13 Blue Led (0 = On, 1 = Off)
[env:hard_SONOFF_POW_R2_4M]
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
framework                 = ${common.framework}
platform                  = ${Sonoff_4M.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
board_build.f_cpu         = ${Sonoff_4M.board_build.f_cpu}
board_build.flash_mode    = ${Sonoff_4M.board_build.flash_mode}
board                     = ${Sonoff_4M.board}
build_unflags             = ${Sonoff_4M.build_unflags}
build_flags               = ${Sonoff_4M.build_flags} -D PLUGIN_SET_SONOFF_POW_R2

; ITEAD / SONOFF S20 version --------------------
;[env:hard_SONOFF_S20]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${Sonoff.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
;board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
;board                     = ${Sonoff.board}
;build_unflags             = ${Sonoff.build_unflags}
;build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_S2x

; ITEAD / SONOFF 4CH version --------------------
;[env:hard_SONOFF_4CH]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${Sonoff.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
;board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
;board                     = ${Sonoff.board}
;build_unflags             = ${Sonoff.build_unflags}
;build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_4CH

; ITEAD / SONOFF TOUCH version ------------------
;[env:hard_SONOFF_TOUCH]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${Sonoff.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_build.f_cpu         = ${Sonoff.board_build.f_cpu}
;board_build.flash_mode    = ${Sonoff.board_build.flash_mode}
;board                     = ${Sonoff.board}
;build_unflags             = ${Sonoff.build_unflags}
;build_flags               = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TOUCH

; Shelly1 Open Source (ESP8266-2MB)
; https://shelly.cloud/shelly1-open-source/
; GPIO04 Relay (non inverted)
; GPIO05 Button
[env:hard_Shelly_1]
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
framework                 = ${common.framework}
platform                  = ${common.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
board_build.f_cpu         = ${esp8266_2M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_2M.board_build.flash_mode}
board                     = ${common.board}
build_unflags             = ${esp8266_2M.build_unflags}
build_flags               = ${esp8266_2M.build_flags} -D PLUGIN_SET_SHELLY_1



; LED Strips ; ****; ****; ****; ****; ****; ****;

; Huacanxing / H801 ------------------------------
;[env:hard_HUACANXING_H801]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_H801

; MagicHome / Led Controller ---------------------
;[env:hard_MAGICHOME]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_MAGICHOME

; MagicHome / Led Controller with IR -------------
;[env:hard_MAGICHOME_IR]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_MAGICHOME_IR




;;; EASY VERSIONS ; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****; ****
; versions specially designed to be small and cover a specific usage                     ;
; *********************************************************************

; Easy Temperature Sensor ------------------------
;[env:easy_TEMP]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_TEMP


; Easy Carbon Sensor -----------------------------
;[env:easy_CARBON]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_CARBON

;; Easy Nextion ----------------------------------
;;PLUGIN_SET_EASY_NEXTION

; Easy OLED Display v1 ---------------------------
;[env:easy_OLED_V1]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_OLED1

; Easy OLED Display v2 ---------------------------
;[env:easy_OLED_V2]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_OLED2

; Easy Relay Switch ------------------------------
;[env:easy_OLED_V2]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_EASY_RELAY

; Easy  Generic (1M) device ----------------------
;[env:easy_GENERIC_1M]
;upload_speed              = ${common.upload_speed}
;monitor_speed             = ${common.monitor_speed}
;framework                 = ${common.framework}
;platform                  = ${common.platform}
;lib_deps                  = ${common.lib_deps}
;lib_ignore                = ${common.lib_ignore}
;lib_ldf_mode              = ${common.lib_ldf_mode}
;lib_archive               = ${common.lib_archive}
;board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
;board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
;board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
;board                     = esp01_1m
;build_unflags             = ${esp8266_1M.build_unflags}
;build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_GENERIC_1M

; Ventus W266 weather station
; https://www.letscontrolit.com/wiki/index.php/VentusW266
[env:hard_Ventus_W266]
platform                  = ${normal.platform}
lib_deps                  = ${common.lib_deps}
lib_ignore                = ${common.lib_ignore}
lib_ldf_mode              = ${common.lib_ldf_mode}
lib_archive               = ${common.lib_archive}
framework                 = ${common.framework}
upload_speed              = ${common.upload_speed}
monitor_speed             = ${common.monitor_speed}
board_upload.maximum_size = ${esp8266_1M.board_upload.maximum_size}
board_build.f_cpu         = ${esp8266_1M.board_build.f_cpu}
board_build.flash_mode    = ${esp8266_1M.board_build.flash_mode}
board                     = ${common.board}
build_unflags             = ${esp8266_1M.build_unflags}
build_flags               = ${esp8266_1M.build_flags} -D PLUGIN_SET_VENTUS_W266
