Skip to content

Commit 77aa2b6

Browse files
committed
Streamline platformio.ini
1 parent 074d53f commit 77aa2b6

File tree

10 files changed

+91
-650
lines changed

10 files changed

+91
-650
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/wled00/Release
88
/wled00/extLibs
99
/platformio_override.ini
10-
/wled00/user_config_override.h
10+
/wled00/my_config.h
1111
/build_output
1212
.DS_Store
1313
.gitignore

pio/override_copy.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

pio/user_config_copy.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Import('env')
2+
import os
3+
import shutil
4+
5+
# copy WLED00/my_config_sample.h to WLED00/my_config.h
6+
if os.path.isfile("wled00/my_config.h"):
7+
print ("*** use existing my_config.h ***")
8+
else:
9+
shutil.copy("wled00/my_config_sample.h", "wled00/my_config.h")

platformio.ini

Lines changed: 42 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,13 @@
22
; Please visit documentation: https://docs.platformio.org/page/projectconf.html
33

44
[platformio]
5-
src_dir = ./wled00
6-
data_dir = ./wled00/data
7-
lib_dir = ./wled00/src
8-
build_cache_dir = ~/.buildcache
9-
extra_configs =
10-
platformio_override.ini
11-
125
# ------------------------------------------------------------------------------
136
# ENVIRONMENTS
147
#
158
# Please uncomment one of the lines below to select your board(s)
169
# ------------------------------------------------------------------------------
1710

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

2114
# Release binaries
@@ -41,36 +34,21 @@ default_envs = travis_esp8266, travis_esp32
4134
; default_envs = m5atom
4235
; default_envs = esp32_poe
4336

37+
src_dir = ./wled00
38+
data_dir = ./wled00/data
39+
build_cache_dir = ~/.buildcache
40+
extra_configs =
41+
platformio_override.ini
42+
4443
[common]
4544
# ------------------------------------------------------------------------------
4645
# PLATFORM:
4746
# !! DO NOT confuse platformio's ESP8266 development platform with Arduino core for ESP8266
4847
#
49-
# arduino core 2.3.0 = platformIO 1.5.0
50-
# arduino core 2.4.0 = platformIO 1.6.0
51-
# arduino core 2.4.1 = platformIO 1.7.3
52-
# arduino core 2.4.2 = platformIO 1.8.0
53-
# arduino core 2.5.0 = platformIO 2.0.4
54-
# arduino core 2.5.1 = platformIO 2.1.1
55-
# arduino core 2.5.2 = platformIO 2.2.3
56-
# arduino core 2.6.1 = platformIO 2.3.0
57-
# arduino core 2.6.2 = platformIO 2.3.1
5848
# arduino core 2.6.3 = platformIO 2.3.2
5949
# arduino core 2.7.0 = platformIO 2.5.0
6050
# ------------------------------------------------------------------------------
61-
arduino_core_2_3_0 = [email protected]
62-
arduino_core_2_4_0 = [email protected]
63-
arduino_core_2_4_1 = [email protected]
64-
arduino_core_2_4_2 = [email protected]
65-
arduino_core_2_5_0 = [email protected]
66-
arduino_core_2_5_1 = [email protected]
67-
arduino_core_2_5_2 = [email protected]
68-
arduino_core_2_6_1 = [email protected]
69-
arduino_core_2_6_2 = [email protected]
7051
arduino_core_2_6_3 = [email protected]
71-
arduino_core_2_7_1 = [email protected]
72-
arduino_core_2_7_2 = [email protected]
73-
arduino_core_2_7_3 = [email protected]
7452
arduino_core_2_7_4 = [email protected]
7553

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

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

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

9471
# ------------------------------------------------------------------------------
95-
# FLAGS: ldscript
72+
# FLAGS: ldscript (available ldscripts at https://github.com/esp8266/Arduino/tree/master/tools/sdk/ld)
9673
# ldscript_512k ( 512 KB) = 487 KB sketch, 4 KB eeprom, no spiffs, 16 KB reserved
9774
# ldscript_1m0m (1024 KB) = 999 KB sketch, 4 KB eeprom, no spiffs, 16 KB reserved
9875
# ldscript_2m1m (2048 KB) = 1019 KB sketch, 4 KB eeprom, 1004 KB spiffs, 16 KB reserved
@@ -103,6 +80,7 @@ debug_flags = -D DEBUG=1 -D WLED_DEBUG -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT
10380
# -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH = v1.4 Higher Bandwidth (default)
10481
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY = v2 Lower Memory
10582
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH = v2 Higher Bandwidth
83+
# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
10684
#
10785
# BearSSL performance:
10886
# When building with -DSECURE_CLIENT=SECURE_CLIENT_BEARSSL, please add `board_build.f_cpu = 160000000` to the environment configuration
@@ -127,36 +105,24 @@ build_flags =
127105
-Wno-sequence-point
128106
-Wno-narrowing
129107
-Wno-reorder
130-
-Wno-unused-local-typedefs
131108
-DMQTT_MAX_PACKET_SIZE=1024
132109
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
133110
-DBEARSSL_SSL_BASIC
134111
-D CORE_DEBUG_LEVEL=0
135112
-D NDEBUG
136-
-DFP_IN_IROM
137-
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
138-
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
139-
; lwIP 2 - Higher Bandwidth no Features
140-
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
141-
; VTABLES in Flash
142-
-DVTABLES_IN_FLASH
143-
; restrict to minimal mime-types
144-
-DMIMETYPE_MINIMAL
145-
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
113+
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
146114
-D _IR_ENABLE_DEFAULT_=false
147115
-D DECODE_HASH=true
148116
-D DECODE_NEC=true
149117
-D DECODE_SONY=true
150118
-D DECODE_SAMSUNG=true
151119
-D DECODE_LG=true
120+
-DWLED_USE_MY_CONFIG
152121

153122
build_unflags =
154123
-Wall
155124
-Wdeprecated-declarations
156125

157-
build_flags_esp8266 = ${common.build_flags} -DESP8266
158-
build_flags_esp32 = ${esp32.build_flags} -DARDUINO_ARCH_ESP32
159-
160126
# enables all features for travis CI
161127
build_flags_all_features =
162128
-D WLED_USE_ANALOG_LED
@@ -167,34 +133,36 @@ build_flags_all_features =
167133
-D WLED_ENABLE_MQTT
168134
-D WLED_ENABLE_WEBSOCKETS
169135

136+
build_flags_esp8266 = ${common.build_flags} ${esp8266.build_flags}
137+
build_flags_esp32 = ${common.build_flags} ${esp32.build_flags}
138+
170139
ldscript_512k = eagle.flash.512k.ld ;for older versions change this to eagle.flash.512k0.ld
171140
ldscript_1m0m = eagle.flash.1m.ld ;for older versions change this to eagle.flash.1m0.ld
172141
ldscript_2m1m = eagle.flash.2m1m.ld
173142
ldscript_4m1m = eagle.flash.4m1m.ld
174-
ldscript_4m3m = eagle.flash.4m3m.ld
175143

176-
shared_libdeps_dir = ./wled00/src
144+
[esp8266]
145+
build_flags =
146+
-DESP8266
147+
-DFP_IN_IROM
148+
; NONOSDK22x_190703 = 2.2.2-dev(38a443e)
149+
-DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703
150+
; lwIP 2 - Higher Bandwidth no Features
151+
-DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
152+
; VTABLES in Flash
153+
-DVTABLES_IN_FLASH
154+
; restrict to minimal mime-types
155+
-DMIMETYPE_MINIMAL
177156

178157
[esp32]
179158
build_flags = -w -g
180-
-DMQTT_MAX_PACKET_SIZE=1024
181-
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
182-
-DBEARSSL_SSL_BASIC
183-
-D CORE_DEBUG_LEVEL=0
184-
-D NDEBUG
185-
#build_flags for the IRremoteESP8266 library (enabled decoders have to appear here)
186-
-D _IR_ENABLE_DEFAULT_=false
187-
-D DECODE_HASH=true
188-
-D DECODE_NEC=true
189-
-D DECODE_SONY=true
190-
-D DECODE_SAMSUNG=true
191-
-D DECODE_LG=true
159+
-DARDUINO_ARCH_ESP32
192160

193161
[scripts_defaults]
194162
extra_scripts = pio/name-firmware.py
195163
pio/gzip-firmware.py
196164
pio/strip-floats.py
197-
pio/override_copy.py
165+
pio/user_config_copy.py
198166

199167
# ------------------------------------------------------------------------------
200168
# COMMON SETTINGS:
@@ -204,12 +172,8 @@ framework = arduino
204172
board_build.flash_mode = dout
205173
monitor_speed = 115200
206174
upload_speed = 115200
207-
; *** Upload Serial reset method for Wemos and NodeMCU
208-
upload_resetmethod = nodemcu
209-
upload_port = COM5
210175

211-
lib_extra_dirs =
212-
${common.shared_libdeps_dir}
176+
lib_extra_dirs = ./wled00/src
213177

214178
# ------------------------------------------------------------------------------
215179
# LIBRARIES: required dependencies
@@ -335,31 +299,31 @@ lib_ignore =
335299

336300
[env:esp8285_4CH_MagicHome]
337301
board = esp8285
338-
platform = ${common.platform_latest}
302+
platform = ${common.platform_wled_default}
339303
platform_packages = ${common.platform_packages}
340304
board_build.ldscript = ${common.ldscript_1m0m}
341305
build_unflags = ${common.build_unflags}
342306
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS
343307

344308
[env:esp8285_4CH_H801]
345309
board = esp8285
346-
platform = ${common.platform_latest}
310+
platform = ${common.platform_wled_default}
347311
platform_packages = ${common.platform_packages}
348312
board_build.ldscript = ${common.ldscript_1m0m}
349313
build_unflags = ${common.build_unflags}
350314
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS -D WLED_USE_H801
351315

352316
[env:esp8285_5CH_H801]
353317
board = esp8285
354-
platform = ${common.platform_latest}
318+
platform = ${common.platform_wled_default}
355319
platform_packages = ${common.platform_packages}
356320
board_build.ldscript = ${common.ldscript_1m0m}
357321
build_unflags = ${common.build_unflags}
358322
build_flags = ${common.build_flags_esp8266} -D WLED_DISABLE_HUESYNC -D WLED_USE_ANALOG_LEDS -D WLED_USE_H801 -D WLED_ENABLE_5CH_LEDS
359323

360324
[env:d1_mini_5CH_Shojo_PCB]
361325
board = d1_mini
362-
platform = ${common.platform_latest}
326+
platform = ${common.platform_wled_default}
363327
platform_packages = ${common.platform_packages}
364328
board_build.ldscript = ${common.ldscript_4m1m}
365329
build_unflags = ${common.build_unflags}
@@ -395,15 +359,15 @@ build_flags = ${common.build_flags_esp8266}
395359

396360
[env:custom_LEDPIN_4]
397361
board = d1_mini
398-
platform = ${common.platform_latest}
362+
platform = ${common.platform_wled_default}
399363
platform_packages = ${common.platform_packages}
400364
board_build.ldscript = ${common.ldscript_4m1m}
401365
build_unflags = ${common.build_unflags}
402366
build_flags = ${common.build_flags_esp8266} -D LEDPIN=4 -D IRPIN=5
403367

404368
[env:custom_LEDPIN_16]
405369
board = d1_mini
406-
platform = ${common.platform_latest}
370+
platform = ${common.platform_wled_default}
407371
platform_packages = ${common.platform_packages}
408372
board_build.ldscript = ${common.ldscript_4m1m}
409373
build_unflags = ${common.build_unflags}
@@ -412,23 +376,23 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=16
412376

413377
[env:custom_LEDPIN_3]
414378
board = d1_mini
415-
platform = ${common.platform_latest}
379+
platform = ${common.platform_wled_default}
416380
platform_packages = ${common.platform_packages}
417381
board_build.ldscript = ${common.ldscript_4m1m}
418382
build_unflags = ${common.build_unflags}
419383
build_flags = ${common.build_flags_esp8266} -D LEDPIN=3
420384

421385
[env:custom_APA102]
422386
board = d1_mini
423-
platform = ${common.platform_latest}
387+
platform = ${common.platform_wled_default}
424388
platform_packages = ${common.platform_packages}
425389
board_build.ldscript = ${common.ldscript_4m1m}
426390
build_unflags = ${common.build_unflags}
427391
build_flags = ${common.build_flags_esp8266} -D USE_APA102
428392

429393
[env:custom_WS2801]
430394
board = d1_mini
431-
platform = ${common.platform_latest}
395+
platform = ${common.platform_wled_default}
432396
platform_packages = ${common.platform_packages}
433397
board_build.ldscript = ${common.ldscript_4m1m}
434398
build_unflags = ${common.build_unflags}
@@ -509,15 +473,15 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=3
509473

510474
[env:codm-controller-0.4-WS2801]
511475
board = esp_wroom_02
512-
platform = ${common.platform_latest}
476+
platform = ${common.platform_wled_default}
513477
platform_packages = ${common.platform_packages}
514478
board_build.ldscript = ${common.ldscript_2m1m}
515479
build_unflags = ${common.build_unflags}
516480
build_flags = ${common.build_flags_esp8266} -D USE_WS2801 -D CLKPIN=13 -D DATAPIN=3
517481

518482
[env:codm-controller-0.4-APA102]
519483
board = esp_wroom_02
520-
platform = ${common.platform_latest}
484+
platform = ${common.platform_wled_default}
521485
platform_packages = ${common.platform_packages}
522486
board_build.ldscript = ${common.ldscript_2m1m}
523487
build_unflags = ${common.build_unflags}
@@ -533,15 +497,15 @@ build_flags = ${common.build_flags_esp8266}
533497

534498
[env:codm-controller-0.5-WS2801]
535499
board = esp_wroom_02
536-
platform = ${common.platform_latest}
500+
platform = ${common.platform_wled_default}
537501
platform_packages = ${common.platform_packages}
538502
board_build.ldscript = ${common.ldscript_2m1m}
539503
build_unflags = ${common.build_unflags}
540504
build_flags = ${common.build_flags_esp8266} -D USE_WS2801 #-D CLKPIN=0 -D DATAPIN=2
541505

542506
[env:codm-controller-0.5-APA102]
543507
board = esp_wroom_02
544-
platform = ${common.platform_latest}
508+
platform = ${common.platform_wled_default}
545509
platform_packages = ${common.platform_packages}
546510
board_build.ldscript = ${common.ldscript_2m1m}
547511
build_unflags = ${common.build_unflags}

platformio_override.ini.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ board_build.ldscript = ${common.ldscript_1m0m}
1515
build_unflags = ${common.build_unflags}
1616
build_flags = ${common.build_flags_esp8266}
1717
; *********************************************************************
18-
; *** Use custom settings from file user_config_override.h
19-
-DUSE_CONFIG_OVERRIDE
18+
; *** Use custom settings from file my_config.h
19+
-DWLED_USE_MY_CONFIG
2020
; *********************************************************************
2121
; -D WLED_DISABLE_OTA
2222
; -D WLED_DISABLE_ALEXA

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a href="https://discord.gg/KuqP7NE"><img src="https://img.shields.io/discord/473448917040758787.svg?colorB=blue&label=discord&style=flat-square"></a>
77
<a href="https://github.com/Aircoookie/WLED/wiki"><img src="https://img.shields.io/badge/quick_start-wiki-blue.svg?style=flat-square"></a>
88
<a href="https://github.com/Aircoookie/WLED-App"><img src="https://img.shields.io/badge/app-wled-blue.svg?style=flat-square"></a>
9-
<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>
9+
<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>
1010

1111
</p>
1212

wled00/const.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@
116116

117117
#define NTP_PACKET_SIZE 48
118118

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

123126
// string temp buffer (now stored in stack locally)

0 commit comments

Comments
 (0)