Pio support of esp32

This commit is contained in:
Daniel Wiesendorf 2018-11-14 00:05:06 +01:00
parent e5cef6b877
commit 612d6f85bd
6 changed files with 89 additions and 50 deletions

View File

@ -1,23 +1,25 @@
; PlatformIO Project Configuration File ; PlatformIO Project Configuration File
; ; Please visit documentation: https://docs.platformio.org/page/projectconf.html
; 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] [platformio]
src_dir = wled00 src_dir = ./wled00
env_default = esp32dev 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 = build_flags =
-D VERSION=0.8.1 -D VERSION=0.9.0-dev
-D DEBUG=1 -D DEBUG=1
framework = arduino framework = arduino
lib_deps_builtin = monitor_speed = 115200
board_build.flash_mode = dout
upload_speed = 921600
upload_resetmethod = nodemcu
lib_deps_external = lib_deps_external =
# TODO replace libs in /lib with managed libs in here if possible # TODO replace libs in /lib with managed libs in here if possible
#Blynk@0.5.4 #Blynk@0.5.4
@ -30,69 +32,106 @@ lib_deps_external =
#Timezone@1.2.1 #Timezone@1.2.1
#WS2812FX@1.1.2 #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 # see: http://docs.platformio.org/en/latest/platforms/espressif8266.html
[env:nodemcuv2] [env:nodemcuv2]
platform = espressif8266 platform = espressif8266
board = nodemcuv2 board = nodemcuv2
monitor_speed = 115200 monitor_speed = ${common.monitor_speed}
framework = ${common_env_data.framework} upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
framework = ${common.framework}
build_flags = build_flags =
${common_env_data.build_flags} ${common.build_flags}
-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
-Teagle.flash.4m.ld
lib_deps = lib_deps =
${common_env_data.lib_deps_builtin} ${common.lib_deps_external}
${common_env_data.lib_deps_external}
[env:d1_mini] [env:d1_mini]
platform = espressif8266 platform = espressif8266
board = d1_mini board = d1_mini
monitor_speed = 115200 monitor_speed = ${common.monitor_speed}
framework = ${common_env_data.framework} upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
framework = ${common.framework}
build_flags = build_flags =
${common_env_data.build_flags} ${common.build_flags}
lib_deps = lib_deps =
${common_env_data.lib_deps_builtin} ${common.lib_deps_external}
${common_env_data.lib_deps_external}
[env:esp01_1m] [env:esp01_1m]
platform = espressif8266 platform = espressif8266
board = esp01_1m board = esp01_1m
monitor_speed = 115200 monitor_speed = ${common.monitor_speed}
framework = ${common_env_data.framework} upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
framework = ${common.framework}
build_flags = build_flags =
${common_env_data.build_flags} ${common.build_flags}
lib_deps = lib_deps =
${common_env_data.lib_deps_builtin} ${common.lib_deps_external}
${common_env_data.lib_deps_external}
[env:esp01] [env:esp01]
platform = espressif8266 platform = espressif8266
board = esp01 board = esp01
monitor_speed = 115200 monitor_speed = ${common.monitor_speed}
framework = ${common_env_data.framework} upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
framework = ${common.framework}
build_flags = build_flags =
${common_env_data.build_flags} ${common.build_flags}
-D WLED_DISABLE_MOBILE_UI ${common:512k.build_flags}
-D WLED_DISABLE_OTA
-D WLED_DISABLE_ALEXA
-D WLED_DISABLE_BLYNK
-D WLED_DISABLE_CRONIXIE
-D WLED_DISABLE_HUESYNC
lib_deps = lib_deps =
${common_env_data.lib_deps_builtin} ${common.lib_deps_external}
${common_env_data.lib_deps_external}
# see: http://docs.platformio.org/en/latest/platforms/espressif32.html # see: http://docs.platformio.org/en/latest/platforms/espressif32.html
[env:esp32dev] [env:esp32dev]
platform = espressif32 platform = espressif32
board = esp32dev board = esp32dev
monitor_speed = 115200 monitor_speed = ${common.monitor_speed}
framework = ${common_env_data.framework} upload_speed = ${common.upload_speed}
upload_resetmethod = ${common.upload_resetmethod}
framework = ${common.framework}
build_flags = build_flags =
${common_env_data.build_flags} ${common.build_flags}
-D ARDUINO_ARCH_ESP32 ${common:esp32.build_flags}
-D WORKAROUND_ESP32_BITBANG
lib_deps = lib_deps =
${common_env_data.lib_deps_builtin} ${common.lib_deps_external}
${common_env_data.lib_deps_external}

View File

@ -173,7 +173,7 @@ class WS2812FX {
typedef struct Segment { // 21 bytes typedef struct Segment { // 21 bytes
uint16_t start; uint16_t start;
uint16_t stop; uint16_t stop;
uint8_t speed; uint16_t speed;
uint8_t intensity; uint8_t intensity;
uint8_t palette; uint8_t palette;
uint8_t mode; uint8_t mode;
@ -481,8 +481,8 @@ class WS2812FX {
uint8_t _segment_index_palette_last = 99; uint8_t _segment_index_palette_last = 99;
uint8_t _num_segments = 1; uint8_t _num_segments = 1;
segment _segments[MAX_NUM_SEGMENTS] = { // SRAM footprint: 20 bytes per element segment _segments[MAX_NUM_SEGMENTS] = { // SRAM footprint: 20 bytes per element
// start, stop, speed, intensity, mode, options, color[] // start, stop, speed, intensity, palette, mode, options, color[]
{ 0, 7, DEFAULT_SPEED, 128, FX_MODE_STATIC, NO_OPTIONS, {DEFAULT_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 segment_runtime _segment_runtimes[MAX_NUM_SEGMENTS]; // SRAM footprint: 17 bytes per element
}; };

View File

@ -59,7 +59,7 @@
#include "htmls00.h" #include "htmls00.h"
#include "htmls01.h" #include "htmls01.h"
#include "htmls02.h" #include "htmls02.h"
#include "WS2812FX.h" #include "src/dependencies/ws2812fx/WS2812FX.h"
//version code in format yymmddb (b = daily build) //version code in format yymmddb (b = daily build)