; 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]
extra_configs =
  wifi_credentials.ini

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino

upload_protocol = esptool
upload_speed = 921600
;upload_port = ChainLube_DDEFB2
;upload_protocol = espota
;upload_flags =  
;    --auth=${wifi_cred.admin_password}

build_flags =
  !python git_rev_macro.py
  -DWIFI_SSID_CLIENT=${wifi_cred.wifi_ssid_client}
  -DWIFI_PASSWORD_CLIENT=${wifi_cred.wifi_password_client}
  -DADMIN_PASSWORD=${wifi_cred.admin_password}
  -DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
  -DWIFI_AP_IP_GW=10,0,0,1
  -DATOMIC_FS_UPDATE
  -DFEATURE_ENABLE_WIFI_CLIENT
  -DFEATURE_ENABLE_OLED
  -DFEATURE_ENABLE_CAN
  ;-DFEATURE_ENABLE_GPS
  -DFEATURE_ENABLE_WEBSOCKETS
  -DPCB_REV=4
  ;-DNO_MODE_FLASH

;build_type = debug

board_build.filesystem = littlefs
extra_scripts = post:prepare_littlefs.py

monitor_filters = esp8266_exception_decoder
monitor_speed = 115200

board_build.ldscript = eagle.flash.4m1m.ld
lib_ldf_mode = deep
lib_deps = 
    olikraus/U8g2 @ ^2.28.8
    https://github.com/FastLED/FastLED.git#3d2ab78 ;fastled/FastLED @ ^3.5.0
    sstaub/Ticker @ ^4.2.0
    coryjfowler/mcp_can @ ^1.5.0
    robtillaart/I2C_EEPROM @ ^1.5.2
    mikalhart/TinyGPSPlus @ ^1.0.3
    me-no-dev/ESP Async WebServer @ ^1.2.3
    bblanchon/ArduinoJson @ ^6.19.4