From b51be31d8a20d42d060367946a258e188f1c82fe Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Thu, 8 Nov 2018 23:57:50 +0100 Subject: [PATCH 01/12] added initial PlatformIO config. still needs work --- .gitignore | 4 +++ .travis.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/README | 39 +++++++++++++++++++++++++++++ lib/README | 46 ++++++++++++++++++++++++++++++++++ platformio.ini | 30 ++++++++++++++++++++++ test/README | 11 +++++++++ 6 files changed, 197 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 include/README create mode 100644 lib/README create mode 100644 platformio.ini create mode 100644 test/README diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..04451df4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.pio +.pioenvs +.piolibdeps +.vscode diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..7c486f18 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,67 @@ +# Continuous Integration (CI) is the practice, in software +# engineering, of merging all developer working copies with a shared mainline +# several times a day < https://docs.platformio.org/page/ci/index.html > +# +# Documentation: +# +# * Travis CI Embedded Builds with PlatformIO +# < https://docs.travis-ci.com/user/integration/platformio/ > +# +# * PlatformIO integration with Travis CI +# < https://docs.platformio.org/page/ci/travis.html > +# +# * User Guide for `platformio ci` command +# < https://docs.platformio.org/page/userguide/cmd_ci.html > +# +# +# Please choose one of the following templates (proposed below) and uncomment +# it (remove "# " before each line) or use own configuration according to the +# Travis CI documentation (see above). +# + + +# +# Template #1: General project. Test it using existing `platformio.ini`. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio run + + +# +# Template #2: The project is intended to be used as a library with examples. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# env: +# - PLATFORMIO_CI_SRC=path/to/test/file.c +# - PLATFORMIO_CI_SRC=examples/file.ino +# - PLATFORMIO_CI_SRC=path/to/test/directory +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/include/README b/include/README new file mode 100644 index 00000000..194dcd43 --- /dev/null +++ b/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/lib/README b/lib/README new file mode 100644 index 00000000..6debab1e --- /dev/null +++ b/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 00000000..d7c56ff7 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,30 @@ +; 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] +src_dir = wled00 + +[env:esp01] +platform = espressif8266 +board = esp01 +framework = arduino +monitor_speed = 115200 +; lib_ldf_mode = chain+ # for overwriting MQTT_MAX_PACKET_SIZE in MqttJsonClient.h, see: http://docs.platformio.org/en/latest/librarymanager/ldf.html#ldf-mode +; build_flags = -DMQTT_MAX_PACKET_SIZE +lib_deps = + Blynk + PubSubClient + E131 + Time + Timezone + webserver + WS2812FX + NeoPixelBus + FastLED diff --git a/test/README b/test/README new file mode 100644 index 00000000..df5066e6 --- /dev/null +++ b/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html From 67013bd58f83eeb27cbc2bdf1884ca8ace899003 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Sun, 11 Nov 2018 19:34:19 +0100 Subject: [PATCH 02/12] Changed platformio.ini. A few boards are building now --- .travis.yml | 58 +++++++------------------------ platformio.ini | 92 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 92 insertions(+), 58 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c486f18..fc9b883e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,49 +19,15 @@ # Travis CI documentation (see above). # - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be used as a library with examples. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# - platformio update -# -# script: -# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N +language: python +python: + - "2.7" +sudo: false +cache: + directories: + - "~/.platformio" +install: + - pip install -U platformio + - platformio update +script: + - platformio run diff --git a/platformio.ini b/platformio.ini index d7c56ff7..eb2662ec 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,21 +10,89 @@ [platformio] src_dir = wled00 +; env_default = nodemcuv2 + + +[common_env_data] +build_flags = + -D VERSION=0.8.1 + -D DEBUG=1 +framework = arduino +lib_deps_builtin = +lib_deps_external = + # TODO replace libs in /lib with managed libs in here if possible + #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 + + +# see: http://docs.platformio.org/en/latest/platforms/espressif8266.html +[env:nodemcuv2] +platform = espressif8266 +board = nodemcuv2 +monitor_speed = 115200 +framework = ${common_env_data.framework} +build_flags = + ${common_env_data.build_flags} +lib_deps = + ${common_env_data.lib_deps_builtin} + ${common_env_data.lib_deps_external} + +[env:d1_mini] +platform = espressif8266 +board = d1_mini +monitor_speed = 115200 +framework = ${common_env_data.framework} +build_flags = + ${common_env_data.build_flags} +lib_deps = + ${common_env_data.lib_deps_builtin} + ${common_env_data.lib_deps_external} + +[env:esp01_1m] +platform = espressif8266 +board = esp01_1m +monitor_speed = 115200 +framework = ${common_env_data.framework} +build_flags = + ${common_env_data.build_flags} +lib_deps = + ${common_env_data.lib_deps_builtin} + ${common_env_data.lib_deps_external} [env:esp01] platform = espressif8266 board = esp01 -framework = arduino monitor_speed = 115200 -; lib_ldf_mode = chain+ # for overwriting MQTT_MAX_PACKET_SIZE in MqttJsonClient.h, see: http://docs.platformio.org/en/latest/librarymanager/ldf.html#ldf-mode -; build_flags = -DMQTT_MAX_PACKET_SIZE +framework = ${common_env_data.framework} +build_flags = + ${common_env_data.build_flags} + -DWLED_DISABLE_MOBILE_UI + -DWLED_DISABLE_OTA + -DWLED_DISABLE_ALEXA + -DWLED_DISABLE_BLYNK + -DWLED_DISABLE_CRONIXIE + -DWLED_DISABLE_HUESYNC lib_deps = - Blynk - PubSubClient - E131 - Time - Timezone - webserver - WS2812FX - NeoPixelBus - FastLED + ${common_env_data.lib_deps_builtin} + ${common_env_data.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} +build_flags = + ${common_env_data.build_flags} + ARDUINO_ARCH_ESP32 +lib_deps = + ${common_env_data.lib_deps_builtin} + ${common_env_data.lib_deps_external} + \ No newline at end of file From a84859c211eb382463125ba278bc47c1830c483f Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Sun, 11 Nov 2018 19:40:08 +0100 Subject: [PATCH 03/12] Changed platformio.ini. A few boards are building now --- platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index eb2662ec..578629a3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -12,7 +12,6 @@ src_dir = wled00 ; env_default = nodemcuv2 - [common_env_data] build_flags = -D VERSION=0.8.1 From 478fa3132c3510f61cd07993c5a38854f03458bc Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Tue, 13 Nov 2018 00:18:49 +0100 Subject: [PATCH 04/12] Minor fixes for PIO support --- .travis.yml | 2 +- platformio.ini | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc9b883e..10e2a9ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,4 +30,4 @@ install: - pip install -U platformio - platformio update script: - - platformio run + - platformio ci --board=nodemcuv2 --board=d1_mini --board=esp01_1m diff --git a/platformio.ini b/platformio.ini index 578629a3..f62ecf07 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [platformio] src_dir = wled00 -; env_default = nodemcuv2 +env_default = esp32dev [common_env_data] build_flags = @@ -72,12 +72,12 @@ monitor_speed = 115200 framework = ${common_env_data.framework} build_flags = ${common_env_data.build_flags} - -DWLED_DISABLE_MOBILE_UI - -DWLED_DISABLE_OTA - -DWLED_DISABLE_ALEXA - -DWLED_DISABLE_BLYNK - -DWLED_DISABLE_CRONIXIE - -DWLED_DISABLE_HUESYNC + -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 lib_deps = ${common_env_data.lib_deps_builtin} ${common_env_data.lib_deps_external} @@ -90,7 +90,8 @@ monitor_speed = 115200 framework = ${common_env_data.framework} build_flags = ${common_env_data.build_flags} - ARDUINO_ARCH_ESP32 + -D ARDUINO_ARCH_ESP32 + -D WORKAROUND_ESP32_BITBANG lib_deps = ${common_env_data.lib_deps_builtin} ${common_env_data.lib_deps_external} From 5a5064e070026b11f2336c010fe452c7f8406e27 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Tue, 13 Nov 2018 00:32:35 +0100 Subject: [PATCH 05/12] fixed travisci build --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10e2a9ef..57053ea4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,11 @@ sudo: false cache: directories: - "~/.platformio" +env: + - PLATFORMIO_CI_SRC=wled00 + - PLATFORMIO_BUILD_FLAGS="-D DEBUG=false" install: - pip install -U platformio - platformio update script: - - platformio ci --board=nodemcuv2 --board=d1_mini --board=esp01_1m + - platformio ci --project-conf=./platformio.ini From f2a63c04a866bb7c9293a7981b029e13a77a9eb3 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Tue, 13 Nov 2018 00:33:51 +0100 Subject: [PATCH 06/12] fixed travisci build again... --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 57053ea4..377c69c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,7 @@ cache: directories: - "~/.platformio" env: - - PLATFORMIO_CI_SRC=wled00 - - PLATFORMIO_BUILD_FLAGS="-D DEBUG=false" + - PLATFORMIO_CI_SRC=wled00 PLATFORMIO_BUILD_FLAGS="-D DEBUG=false" install: - pip install -U platformio - platformio update From e5cef6b8777274e6f67692f4a2d4284e759732f6 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Tue, 13 Nov 2018 00:37:12 +0100 Subject: [PATCH 07/12] fixed DEBUG constant for travis build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 377c69c0..5649c37f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ cache: directories: - "~/.platformio" env: - - PLATFORMIO_CI_SRC=wled00 PLATFORMIO_BUILD_FLAGS="-D DEBUG=false" + - PLATFORMIO_CI_SRC=wled00 PLATFORMIO_BUILD_FLAGS="-D DEBUG=0" install: - pip install -U platformio - platformio update From 612d6f85bdb5700fc2f9240ad2a8baae19f64b84 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Wed, 14 Nov 2018 00:05:06 +0100 Subject: [PATCH 08/12] Pio support of esp32 --- platformio.ini | 131 ++++++++++++------ .../dependencies/ws2812fx}/NpbWrapper.h | 0 .../dependencies/ws2812fx}/WS2812FX.cpp | 0 .../dependencies/ws2812fx}/WS2812FX.h | 6 +- .../dependencies/ws2812fx}/palettes.h | 0 wled00/wled00.ino | 2 +- 6 files changed, 89 insertions(+), 50 deletions(-) rename wled00/{ => src/dependencies/ws2812fx}/NpbWrapper.h (100%) rename wled00/{ => src/dependencies/ws2812fx}/WS2812FX.cpp (100%) rename wled00/{ => src/dependencies/ws2812fx}/WS2812FX.h (99%) rename wled00/{ => src/dependencies/ws2812fx}/palettes.h (100%) diff --git a/platformio.ini b/platformio.ini index f62ecf07..2a3653ca 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 33e274eb..4ab1e837 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 a04e0f46..c23ab2d7 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) From 5c794f428a5846f08bc3f8e177c2c6c02a7ebfe3 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Wed, 14 Nov 2018 00:18:08 +0100 Subject: [PATCH 09/12] added verbose flag to travisci.yml for debugging --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5649c37f..b2fe6c5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,4 +32,4 @@ install: - pip install -U platformio - platformio update script: - - platformio ci --project-conf=./platformio.ini + - platformio ci --project-conf=./platformio.ini -v From 868cedeed23e2268dfed78e19dbd52f746a5d754 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Wed, 14 Nov 2018 20:21:36 +0100 Subject: [PATCH 10/12] pio support for esp01 512k --- .travis.yml | 2 +- platformio.ini | 78 ++++++++++++++++++++------------------------------ 2 files changed, 32 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2fe6c5f..c4408c4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ cache: directories: - "~/.platformio" env: - - PLATFORMIO_CI_SRC=wled00 PLATFORMIO_BUILD_FLAGS="-D DEBUG=0" + - PLATFORMIO_CI_SRC=wled00 install: - pip install -U platformio - platformio update diff --git a/platformio.ini b/platformio.ini index 2a3653ca..4f44fb61 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,36 +11,15 @@ env_default = esp01 ; env_default = d1_mini ; env_default = esp32dev -[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 -lib_deps_external = - # TODO replace libs in /lib with managed libs in here if possible - #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] -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 +build_flags = + ; -D VERSION=0.9.0-dev + ; -D DEBUG # 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 = @@ -54,80 +33,85 @@ lib_deps_external = #Timezone@1.2.1 #WS2812FX@1.1.2 -[common:esp32] +[common:esp8266] +platform = espressif8266@1.8.0 build_flags = - -DARDUINO_ARCH_ESP32 - -DWORKAROUND_ESP32_BITBANG + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH -[common:512k] +[common:esp8266_512k] +platform = espressif8266@1.7.0 build_flags = - -DWLED_DISABLE_MOBILE_UI - -DWLED_DISABLE_OTA - -DWLED_DISABLE_ALEXA - -DWLED_DISABLE_BLYNK - -DWLED_DISABLE_CRONIXIE - -DWLED_DISABLE_HUESYNC + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH + -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:esp32] +platform = espressif32@1.5.0 +build_flags = + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + -D ARDUINO_ARCH_ESP32 + -D WORKAROUND_ESP32_BITBANG # see: http://docs.platformio.org/en/latest/platforms/espressif8266.html [env:nodemcuv2] -platform = espressif8266 board = nodemcuv2 +platform = ${common:esp8266.platform} monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} -upload_resetmethod = ${common.upload_resetmethod} framework = ${common.framework} build_flags = ${common.build_flags} - -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH - -Teagle.flash.4m.ld + ${common:esp8266.build_flags} lib_deps = ${common.lib_deps_external} [env:d1_mini] -platform = espressif8266 board = d1_mini +platform = ${common:esp8266.platform} monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} -upload_resetmethod = ${common.upload_resetmethod} framework = ${common.framework} build_flags = ${common.build_flags} + ${common:esp8266.build_flags} lib_deps = ${common.lib_deps_external} [env:esp01_1m] -platform = espressif8266 board = esp01_1m +platform = ${common:esp8266.platform} monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} -upload_resetmethod = ${common.upload_resetmethod} framework = ${common.framework} build_flags = ${common.build_flags} + ${common:esp8266.build_flags} lib_deps = ${common.lib_deps_external} [env:esp01] -platform = espressif8266 board = esp01 +platform = ${common:esp8266_512k.platform} monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} -upload_resetmethod = ${common.upload_resetmethod} framework = ${common.framework} build_flags = ${common.build_flags} - ${common:512k.build_flags} + ${common:esp8266_512k.build_flags} lib_deps = ${common.lib_deps_external} # see: http://docs.platformio.org/en/latest/platforms/espressif32.html [env:esp32dev] -platform = espressif32 board = esp32dev +platform = ${common:esp32.platform} monitor_speed = ${common.monitor_speed} upload_speed = ${common.upload_speed} -upload_resetmethod = ${common.upload_resetmethod} framework = ${common.framework} build_flags = ${common.build_flags} From 93eb4d21bf5ba6f2297f3e89b5e8207a08016279 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Wed, 14 Nov 2018 21:11:21 +0100 Subject: [PATCH 11/12] Added PIO recommendation when opening in vscode --- .gitignore | 1 + .vscode/extensions.json | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index 04451df4..2edd9412 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .pioenvs .piolibdeps .vscode +!.vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..8281e64c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} \ No newline at end of file From 8a2b34adb44cb249adc1771c5cec0c605d3ae7f0 Mon Sep 17 00:00:00 2001 From: Daniel Wiesendorf Date: Fri, 16 Nov 2018 15:02:09 +0100 Subject: [PATCH 12/12] moved ws2812fx sources back --- wled00/{src/dependencies/ws2812fx => }/NpbWrapper.h | 0 wled00/{src/dependencies/ws2812fx => }/WS2812FX.cpp | 0 wled00/{src/dependencies/ws2812fx => }/WS2812FX.h | 0 wled00/{src/dependencies/ws2812fx => }/palettes.h | 0 wled00/wled00.ino | 2 +- 5 files changed, 1 insertion(+), 1 deletion(-) rename wled00/{src/dependencies/ws2812fx => }/NpbWrapper.h (100%) rename wled00/{src/dependencies/ws2812fx => }/WS2812FX.cpp (100%) rename wled00/{src/dependencies/ws2812fx => }/WS2812FX.h (100%) rename wled00/{src/dependencies/ws2812fx => }/palettes.h (100%) diff --git a/wled00/src/dependencies/ws2812fx/NpbWrapper.h b/wled00/NpbWrapper.h similarity index 100% rename from wled00/src/dependencies/ws2812fx/NpbWrapper.h rename to wled00/NpbWrapper.h diff --git a/wled00/src/dependencies/ws2812fx/WS2812FX.cpp b/wled00/WS2812FX.cpp similarity index 100% rename from wled00/src/dependencies/ws2812fx/WS2812FX.cpp rename to wled00/WS2812FX.cpp diff --git a/wled00/src/dependencies/ws2812fx/WS2812FX.h b/wled00/WS2812FX.h similarity index 100% rename from wled00/src/dependencies/ws2812fx/WS2812FX.h rename to wled00/WS2812FX.h diff --git a/wled00/src/dependencies/ws2812fx/palettes.h b/wled00/palettes.h similarity index 100% rename from wled00/src/dependencies/ws2812fx/palettes.h rename to wled00/palettes.h diff --git a/wled00/wled00.ino b/wled00/wled00.ino index c23ab2d7..a04e0f46 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -59,7 +59,7 @@ #include "htmls00.h" #include "htmls01.h" #include "htmls02.h" -#include "src/dependencies/ws2812fx/WS2812FX.h" +#include "WS2812FX.h" //version code in format yymmddb (b = daily build)