Skip to content

Commit

Permalink
Streamline platformio.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Nov 17, 2020
1 parent 074d53f commit 77aa2b6
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 650 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/wled00/Release
/wled00/extLibs
/platformio_override.ini
/wled00/user_config_override.h
/wled00/my_config.h
/build_output
.DS_Store
.gitignore
Expand Down
9 changes: 0 additions & 9 deletions pio/override_copy.py

This file was deleted.

9 changes: 9 additions & 0 deletions pio/user_config_copy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Import('env')
import os
import shutil

# copy WLED00/my_config_sample.h to WLED00/my_config.h
if os.path.isfile("wled00/my_config.h"):
print ("*** use existing my_config.h ***")
else:
shutil.copy("wled00/my_config_sample.h", "wled00/my_config.h")
120 changes: 42 additions & 78 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@
; Please visit documentation: https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = ./wled00
data_dir = ./wled00/data
lib_dir = ./wled00/src
build_cache_dir = ~/.buildcache
extra_configs =
platformio_override.ini

# ------------------------------------------------------------------------------
# ENVIRONMENTS
#
# Please uncomment one of the lines below to select your board(s)
# ------------------------------------------------------------------------------

# Travis CI binaries
# Travis CI binaries (comment this out with a ';' when building for your own board)
default_envs = travis_esp8266, travis_esp32

# Release binaries
Expand All @@ -41,36 +34,21 @@ default_envs = travis_esp8266, travis_esp32
; default_envs = m5atom
; default_envs = esp32_poe

src_dir = ./wled00
data_dir = ./wled00/data
build_cache_dir = ~/.buildcache
extra_configs =
platformio_override.ini

[common]
# ------------------------------------------------------------------------------
# PLATFORM:
# !! DO NOT confuse platformio's ESP8266 development platform with Arduino core for ESP8266
#
# arduino core 2.3.0 = platformIO 1.5.0
# arduino core 2.4.0 = platformIO 1.6.0
# arduino core 2.4.1 = platformIO 1.7.3
# arduino core 2.4.2 = platformIO 1.8.0
# arduino core 2.5.0 = platformIO 2.0.4
# arduino core 2.5.1 = platformIO 2.1.1
# arduino core 2.5.2 = platformIO 2.2.3
# arduino core 2.6.1 = platformIO 2.3.0
# arduino core 2.6.2 = platformIO 2.3.1
# arduino core 2.6.3 = platformIO 2.3.2
# arduino core 2.7.0 = platformIO 2.5.0
# ------------------------------------------------------------------------------
arduino_core_2_3_0 = espressif8266@1.5.0
arduino_core_2_4_0 = espressif8266@1.6.0
arduino_core_2_4_1 = espressif8266@1.7.3
arduino_core_2_4_2 = espressif8266@1.8.0
arduino_core_2_5_0 = espressif8266@2.0.4
arduino_core_2_5_1 = espressif8266@2.1.1
arduino_core_2_5_2 = espressif8266@2.2.3
arduino_core_2_6_1 = espressif8266@2.3.0
arduino_core_2_6_2 = espressif8266@2.3.1
arduino_core_2_6_3 = espressif8266@2.3.3
arduino_core_2_7_1 = espressif8266@2.5.1
arduino_core_2_7_2 = espressif8266@2.6.0
arduino_core_2_7_3 = espressif8266@2.6.1
arduino_core_2_7_4 = espressif8266@2.6.2

# Development platforms
Expand All @@ -79,7 +57,6 @@ arduino_core_git = https://github.com/platformio/platform-espressif8266#feature/

# Platform to use for ESP8266
platform_wled_default = ${common.arduino_core_2_7_4}
platform_latest = ${common.arduino_core_2_7_4}
# We use 2.7.4.7 for all, includes PWM flicker fix and Wstring optimization
platform_packages = tasmota/framework-arduinoespressif8266 @ 3.20704.7

Expand All @@ -92,7 +69,7 @@ debug_flags = -D DEBUG=1 -D WLED_DEBUG -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT
#-DDEBUG_ESP_CORE is not working right now

# ------------------------------------------------------------------------------
# FLAGS: ldscript
# FLAGS: ldscript (available ldscripts at https://github.com/esp8266/Arduino/tree/master/tools/sdk/ld)
# ldscript_512k ( 512 KB) = 487 KB sketch, 4 KB eeprom, no spiffs, 16 KB reserved
# ldscript_1m0m (1024 KB) = 999 KB sketch, 4 KB eeprom, no spiffs, 16 KB reserved
# ldscript_2m1m (2048 KB) = 1019 KB sketch, 4 KB eeprom, 1004 KB spiffs, 16 KB reserved
Expand All @@ -103,6 +80,7 @@ debug_flags = -D DEBUG=1 -D WLED_DEBUG -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT
# -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH = v1.4 Higher Bandwidth (default)
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY = v2 Lower Memory
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH = v2 Higher Bandwidth
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
#
# BearSSL performance:
# When building with -DSECURE_CLIENT=SECURE_CLIENT_BEARSSL, please add `board_build.f_cpu = 160000000` to the environment configuration
Expand All @@ -127,36 +105,24 @@ build_flags =
-Wno-sequence-point
-Wno-narrowing
-Wno-reorder
-Wno-unused-local-typedefs
-DMQTT_MAX_PACKET_SIZE=1024
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
-DBEARSSL_SSL_BASIC
-D CORE_DEBUG_LEVEL=0
-D NDEBUG
-DFP_IN_IROM
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
; lwIP 2 - Higher Bandwidth no Features
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; VTABLES in Flash
-DVTABLES_IN_FLASH
; restrict to minimal mime-types
-DMIMETYPE_MINIMAL
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
-D _IR_ENABLE_DEFAULT_=false
-D DECODE_HASH=true
-D DECODE_NEC=true
-D DECODE_SONY=true
-D DECODE_SAMSUNG=true
-D DECODE_LG=true
-DWLED_USE_MY_CONFIG

build_unflags =
-Wall
-Wdeprecated-declarations

build_flags_esp8266 = ${common.build_flags} -DESP8266
build_flags_esp32 = ${esp32.build_flags} -DARDUINO_ARCH_ESP32

# enables all features for travis CI
build_flags_all_features =
-D WLED_USE_ANALOG_LED
Expand All @@ -167,34 +133,36 @@ build_flags_all_features =
-D WLED_ENABLE_MQTT
-D WLED_ENABLE_WEBSOCKETS

build_flags_esp8266 = ${common.build_flags} ${esp8266.build_flags}
build_flags_esp32 = ${common.build_flags} ${esp32.build_flags}

ldscript_512k = eagle.flash.512k.ld ;for older versions change this to eagle.flash.512k0.ld
ldscript_1m0m = eagle.flash.1m.ld ;for older versions change this to eagle.flash.1m0.ld
ldscript_2m1m = eagle.flash.2m1m.ld
ldscript_4m1m = eagle.flash.4m1m.ld
ldscript_4m3m = eagle.flash.4m3m.ld

shared_libdeps_dir = ./wled00/src
[esp8266]
build_flags =
-DESP8266
-DFP_IN_IROM
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
; lwIP 2 - Higher Bandwidth no Features
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; VTABLES in Flash
-DVTABLES_IN_FLASH
; restrict to minimal mime-types
-DMIMETYPE_MINIMAL

[esp32]
build_flags = -w -g
-DMQTT_MAX_PACKET_SIZE=1024
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
-DBEARSSL_SSL_BASIC
-D CORE_DEBUG_LEVEL=0
-D NDEBUG
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
-D _IR_ENABLE_DEFAULT_=false
-D DECODE_HASH=true
-D DECODE_NEC=true
-D DECODE_SONY=true
-D DECODE_SAMSUNG=true
-D DECODE_LG=true
-DARDUINO_ARCH_ESP32

[scripts_defaults]
extra_scripts = pio/name-firmware.py
pio/gzip-firmware.py
pio/strip-floats.py
pio/override_copy.py
pio/user_config_copy.py

# ------------------------------------------------------------------------------
# COMMON SETTINGS:
Expand All @@ -204,12 +172,8 @@ framework = arduino
board_build.flash_mode = dout
monitor_speed = 115200
upload_speed = 115200
; *** Upload Serial reset method for Wemos and NodeMCU
upload_resetmethod = nodemcu
upload_port = COM5

lib_extra_dirs =
${common.shared_libdeps_dir}
lib_extra_dirs = ./wled00/src

# ------------------------------------------------------------------------------
# LIBRARIES: required dependencies
Expand Down Expand Up @@ -335,31 +299,31 @@ lib_ignore =

[env:esp8285_4CH_MagicHome]
board = esp8285
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_1m0m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS

[env:esp8285_4CH_H801]
board = esp8285
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_1m0m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS -D WLED_USE_H801

[env:esp8285_5CH_H801]
board = esp8285
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_1m0m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS -D WLED_USE_H801 -D WLED_ENABLE_5CH_LEDS

[env:d1_mini_5CH_Shojo_PCB]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
Expand Down Expand Up @@ -395,15 +359,15 @@ build_flags = ${common.build_flags_esp8266}

[env:custom_LEDPIN_4]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D LEDPIN=4 -D IRPIN=5

[env:custom_LEDPIN_16]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
Expand All @@ -412,23 +376,23 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=16

[env:custom_LEDPIN_3]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D LEDPIN=3

[env:custom_APA102]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D USE_APA102

[env:custom_WS2801]
board = d1_mini
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
Expand Down Expand Up @@ -509,15 +473,15 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=3

[env:codm-controller-0.4-WS2801]
board = esp_wroom_02
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D USE_WS2801 -D CLKPIN=13 -D DATAPIN=3

[env:codm-controller-0.4-APA102]
board = esp_wroom_02
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m1m}
build_unflags = ${common.build_unflags}
Expand All @@ -533,15 +497,15 @@ build_flags = ${common.build_flags_esp8266}

[env:codm-controller-0.5-WS2801]
board = esp_wroom_02
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m1m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266} -D USE_WS2801 #-D CLKPIN=0 -D DATAPIN=2

[env:codm-controller-0.5-APA102]
board = esp_wroom_02
platform = ${common.platform_latest}
platform = ${common.platform_wled_default}
platform_packages = ${common.platform_packages}
board_build.ldscript = ${common.ldscript_2m1m}
build_unflags = ${common.build_unflags}
Expand Down
4 changes: 2 additions & 2 deletions platformio_override.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ board_build.ldscript = ${common.ldscript_1m0m}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp8266}
; *********************************************************************
; *** Use custom settings from file user_config_override.h
-DUSE_CONFIG_OVERRIDE
; *** Use custom settings from file my_config.h
-DWLED_USE_MY_CONFIG
; *********************************************************************
; -D WLED_DISABLE_OTA
; -D WLED_DISABLE_ALEXA
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://discord.gg/KuqP7NE"><img src="https://img.shields.io/discord/473448917040758787.svg?colorB=blue&label=discord&style=flat-square"></a>
<a href="https://github.com/Aircoookie/WLED/wiki"><img src="https://img.shields.io/badge/quick_start-wiki-blue.svg?style=flat-square"></a>
<a href="https://github.com/Aircoookie/WLED-App"><img src="https://img.shields.io/badge/app-wled-blue.svg?style=flat-square"></a>
<a href="https://gitpod.io/#https://github.com/Jason2866/WLED"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod"></a>
<a href="https://gitpod.io/#https://github.com/Aircoookie/WLED"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?style=flat-square&logo=gitpod"></a>

</p>

Expand Down
5 changes: 4 additions & 1 deletion wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@

#define NTP_PACKET_SIZE 48

// maximum number of LEDs - MAX_LEDS is coming from the JSON response getting too big, MAX_LEDS_DMA will become a timing issue
// maximum number of LEDs - more than 1500 LEDs (or 500 DMA "LEDPIN 3" driven ones) will cause a low memory condition on ESP8266
#ifndef MAX_LEDS
#define MAX_LEDS 1500
#endif

#define MAX_LEDS_DMA 500

// string temp buffer (now stored in stack locally)
Expand Down
Loading

0 comments on commit 77aa2b6

Please sign in to comment.