diff --git a/platformio.ini b/platformio.ini index f62ecf075..2a3653caa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,23 +1,25 @@ ; 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 +; Please visit documentation: https://docs.platformio.org/page/projectconf.html [platformio] -src_dir = wled00 -env_default = esp32dev +src_dir = ./wled00 +data_dir = ./wled00/data +lib_extra_dirs = ./wled00/src +; env_default = nodemcuv2 +env_default = esp01 +; env_default = esp01_1m +; env_default = d1_mini +; env_default = esp32dev -[common_env_data] +[common] build_flags = - -D VERSION=0.8.1 + -D VERSION=0.9.0-dev -D DEBUG=1 framework = arduino -lib_deps_builtin = +monitor_speed = 115200 +board_build.flash_mode = dout +upload_speed = 921600 +upload_resetmethod = nodemcu lib_deps_external = # TODO replace libs in /lib with managed libs in here if possible #Blynk@0.5.4 @@ -30,69 +32,106 @@ lib_deps_external = #Timezone@1.2.1 #WS2812FX@1.1.2 +[common] +build_flags = + -D VERSION=0.9.0-dev + -D DEBUG=1 +framework = arduino +monitor_speed = 115200 +board_build.flash_mode = dout +upload_speed = 921600 +upload_resetmethod = nodemcu +# TODO replace libs in /lib with managed libs in here if possible. +# If they are not changed it's just a metter of setting the correfct version and change the import statement +lib_deps_external = + #Blynk@0.5.4 + #E131@1.0.0 + #webserver + FastLED@3.2.1 + NeoPixelBus@2.3.4 + #PubSubClient@2.7 + #Time@1.5 + #Timezone@1.2.1 + #WS2812FX@1.1.2 + +[common:esp32] +build_flags = + -DARDUINO_ARCH_ESP32 + -DWORKAROUND_ESP32_BITBANG + +[common:512k] +build_flags = + -DWLED_DISABLE_MOBILE_UI + -DWLED_DISABLE_OTA + -DWLED_DISABLE_ALEXA + -DWLED_DISABLE_BLYNK + -DWLED_DISABLE_CRONIXIE + -DWLED_DISABLE_HUESYNC + # see: http://docs.platformio.org/en/latest/platforms/espressif8266.html [env:nodemcuv2] platform = espressif8266 board = nodemcuv2 -monitor_speed = 115200 -framework = ${common_env_data.framework} +monitor_speed = ${common.monitor_speed} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +framework = ${common.framework} build_flags = - ${common_env_data.build_flags} + ${common.build_flags} + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + -Teagle.flash.4m.ld lib_deps = - ${common_env_data.lib_deps_builtin} - ${common_env_data.lib_deps_external} + ${common.lib_deps_external} [env:d1_mini] platform = espressif8266 board = d1_mini -monitor_speed = 115200 -framework = ${common_env_data.framework} +monitor_speed = ${common.monitor_speed} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +framework = ${common.framework} build_flags = - ${common_env_data.build_flags} + ${common.build_flags} lib_deps = - ${common_env_data.lib_deps_builtin} - ${common_env_data.lib_deps_external} + ${common.lib_deps_external} [env:esp01_1m] platform = espressif8266 board = esp01_1m -monitor_speed = 115200 -framework = ${common_env_data.framework} +monitor_speed = ${common.monitor_speed} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +framework = ${common.framework} build_flags = - ${common_env_data.build_flags} + ${common.build_flags} lib_deps = - ${common_env_data.lib_deps_builtin} - ${common_env_data.lib_deps_external} + ${common.lib_deps_external} [env:esp01] platform = espressif8266 board = esp01 -monitor_speed = 115200 -framework = ${common_env_data.framework} +monitor_speed = ${common.monitor_speed} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +framework = ${common.framework} build_flags = - ${common_env_data.build_flags} - -D WLED_DISABLE_MOBILE_UI - -D WLED_DISABLE_OTA - -D WLED_DISABLE_ALEXA - -D WLED_DISABLE_BLYNK - -D WLED_DISABLE_CRONIXIE - -D WLED_DISABLE_HUESYNC + ${common.build_flags} + ${common:512k.build_flags} lib_deps = - ${common_env_data.lib_deps_builtin} - ${common_env_data.lib_deps_external} + ${common.lib_deps_external} # see: http://docs.platformio.org/en/latest/platforms/espressif32.html [env:esp32dev] platform = espressif32 board = esp32dev -monitor_speed = 115200 -framework = ${common_env_data.framework} +monitor_speed = ${common.monitor_speed} +upload_speed = ${common.upload_speed} +upload_resetmethod = ${common.upload_resetmethod} +framework = ${common.framework} build_flags = - ${common_env_data.build_flags} - -D ARDUINO_ARCH_ESP32 - -D WORKAROUND_ESP32_BITBANG + ${common.build_flags} + ${common:esp32.build_flags} lib_deps = - ${common_env_data.lib_deps_builtin} - ${common_env_data.lib_deps_external} + ${common.lib_deps_external} \ No newline at end of file diff --git a/wled00/NpbWrapper.h b/wled00/src/dependencies/ws2812fx/NpbWrapper.h similarity index 100% rename from wled00/NpbWrapper.h rename to wled00/src/dependencies/ws2812fx/NpbWrapper.h diff --git a/wled00/WS2812FX.cpp b/wled00/src/dependencies/ws2812fx/WS2812FX.cpp similarity index 100% rename from wled00/WS2812FX.cpp rename to wled00/src/dependencies/ws2812fx/WS2812FX.cpp diff --git a/wled00/WS2812FX.h b/wled00/src/dependencies/ws2812fx/WS2812FX.h similarity index 99% rename from wled00/WS2812FX.h rename to wled00/src/dependencies/ws2812fx/WS2812FX.h index 33e274ebf..4ab1e837a 100644 --- a/wled00/WS2812FX.h +++ b/wled00/src/dependencies/ws2812fx/WS2812FX.h @@ -173,7 +173,7 @@ class WS2812FX { typedef struct Segment { // 21 bytes uint16_t start; uint16_t stop; - uint8_t speed; + uint16_t speed; uint8_t intensity; uint8_t palette; uint8_t mode; @@ -481,8 +481,8 @@ class WS2812FX { uint8_t _segment_index_palette_last = 99; uint8_t _num_segments = 1; segment _segments[MAX_NUM_SEGMENTS] = { // SRAM footprint: 20 bytes per element - // start, stop, speed, intensity, mode, options, color[] - { 0, 7, DEFAULT_SPEED, 128, FX_MODE_STATIC, NO_OPTIONS, {DEFAULT_COLOR}} + // start, stop, speed, intensity, palette, mode, options, color[] + {0, 7, DEFAULT_SPEED, 128, 0, FX_MODE_STATIC, NO_OPTIONS, {DEFAULT_COLOR}} }; segment_runtime _segment_runtimes[MAX_NUM_SEGMENTS]; // SRAM footprint: 17 bytes per element }; diff --git a/wled00/palettes.h b/wled00/src/dependencies/ws2812fx/palettes.h similarity index 100% rename from wled00/palettes.h rename to wled00/src/dependencies/ws2812fx/palettes.h diff --git a/wled00/wled00.ino b/wled00/wled00.ino index a04e0f461..c23ab2d72 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -59,7 +59,7 @@ #include "htmls00.h" #include "htmls01.h" #include "htmls02.h" -#include "WS2812FX.h" +#include "src/dependencies/ws2812fx/WS2812FX.h" //version code in format yymmddb (b = daily build)