Merge branch 'master' into esp32_multistrip

This commit is contained in:
Sam Martin 2020-12-05 08:16:15 -06:00
commit 7b875ed378
14 changed files with 145 additions and 52 deletions

View File

@ -31,14 +31,15 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python"
"ms-python.python",
"platformio.platformio-ide"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
"postCreateCommand": "npm install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"

42
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build: HTML and binary",
"dependsOn": [
"Build: HTML only",
"Build: binary only"
],
"dependsOrder": "sequence",
"problemMatcher": [
"$platformio",
],
},
{
"type": "PlatformIO",
"label": "Build: binary only",
"task": "Build",
"group": {
"kind": "build",
"isDefault": true,
},
"problemMatcher": [
"$platformio"
],
"presentation": {
"panel": "shared"
}
},
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": [],
"label": "Build: HTML only",
"detail": "npm run build",
"presentation": {
"panel": "shared"
}
}
]
}

View File

@ -2,6 +2,11 @@
### WLED version 0.11.0
#### Build 2012020
- UDP `parsePacket()` with sync disabled (#1390)
- Added Multi RGBW DMX mode (PR #1383)
#### Build 2012010
- Fixed compilation for analog (PWM) LEDs

View File

@ -59,6 +59,9 @@ arduino_core_git = https://github.com/platformio/platform-espressif8266#feature/
platform_wled_default = ${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
platformio/toolchain-xtensa @ ~2.40802.200502
platformio/tool-esptool @ ~1.413.0
platformio/tool-esptoolpy @ ~1.30000.0
# ------------------------------------------------------------------------------
# FLAGS: DEBUG
@ -104,7 +107,6 @@ build_flags =
-Wno-return-type
-Wno-sequence-point
-Wno-narrowing
-Wno-reorder
-DMQTT_MAX_PACKET_SIZE=1024
-DSECURE_CLIENT=SECURE_CLIENT_BEARSSL
-DBEARSSL_SSL_BASIC
@ -121,6 +123,7 @@ build_flags =
build_unflags =
-Wall
-Wreorder
-Wdeprecated-declarations
# enables all features for travis CI
@ -187,7 +190,7 @@ upload_speed = 115200
# ------------------------------------------------------------------------------
lib_compat_mode = strict
lib_deps =
FastLED@3.3.2
fastled/FastLED @ 3.3.2
NeoPixelBus @ 2.6.0
ESPAsyncTCP @ 1.2.0
ESPAsyncUDP

View File

@ -741,7 +741,7 @@ const char JSON_palette_names[] PROGMEM = R"=====([
"Pastel","Sunset 2","Beech","Vintage","Departure","Landscape","Beach","Sherbet","Hult","Hult 64",
"Drywet","Jul","Grintage","Rewhi","Tertiary","Fire","Icefire","Cyane","Light Pink","Autumn",
"Magenta","Magred","Yelmag","Yelblu","Orange & Teal","Tiamat","April Night","Orangery","C9","Sakura",
"Aurora","Atlantica","C9 2","C9 New"
"Aurora","Atlantica","C9 2","C9 New","Temperature"
])=====";
#endif

View File

@ -71,6 +71,7 @@
#define DMX_MODE_EFFECT 3 //trigger standalone effects of WLED (11 channels)
#define DMX_MODE_MULTIPLE_RGB 4 //every LED is addressed with its own RGB (ledCount * 3 channels)
#define DMX_MODE_MULTIPLE_DRGB 5 //every LED is addressed with its own RGB and share a master dimmer (ledCount * 3 + 1 channels)
#define DMX_MODE_MULTIPLE_RGBW 6 //every LED is addressed with its own RGBW (ledCount * 4 channels)
//Light capability byte (unused) 0bRRCCTTTT
//bits 0/1/2/3: specifies a type of LED driver. A single "driver" may have different chip models but must have the same protocol/behavior

View File

@ -64,6 +64,7 @@ DMX mode:
<option value=3>Effect</option>
<option value=4>Multi RGB</option>
<option value=5>Dimmer + Multi RGB</option>
<option value=6>Multi RGBW</option>
</select><br>
<a href="https://github.com/Aircoookie/WLED/wiki/E1.31-DMX" target="_blank">E1.31 info</a><br>
Timeout: <input name="ET" type="number" min="1" max="65000" required> ms<br>

View File

@ -1,6 +1,7 @@
#include "wled.h"
#define MAX_LEDS_PER_UNIVERSE 170
#define MAX_3_CH_LEDS_PER_UNIVERSE 170
#define MAX_4_CH_LEDS_PER_UNIVERSE 128
#define MAX_CHANNELS_PER_UNIVERSE 512
/*
@ -161,8 +162,12 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
case DMX_MODE_MULTIPLE_DRGB:
case DMX_MODE_MULTIPLE_RGB:
case DMX_MODE_MULTIPLE_RGBW:
{
realtimeLock(realtimeTimeoutMs, mde);
bool is4Chan = (DMXMode == DMX_MODE_MULTIPLE_RGBW);
const uint16_t dmxChannelsPerLed = is4Chan ? 4 : 3;
const uint16_t ledsPerUniverse = is4Chan ? MAX_4_CH_LEDS_PER_UNIVERSE : MAX_3_CH_LEDS_PER_UNIVERSE;
if (realtimeOverride) return;
uint16_t previousLeds, dmxOffset;
if (previousUniverses == 0) {
@ -176,13 +181,19 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
} else {
// All subsequent universes start at the first channel.
dmxOffset = (protocol == P_ARTNET) ? 0 : 1;
uint16_t ledsInFirstUniverse = (MAX_CHANNELS_PER_UNIVERSE - DMXAddress) / 3;
previousLeds = ledsInFirstUniverse + (previousUniverses - 1) * MAX_LEDS_PER_UNIVERSE;
uint16_t ledsInFirstUniverse = (MAX_CHANNELS_PER_UNIVERSE - DMXAddress) / dmxChannelsPerLed;
previousLeds = ledsInFirstUniverse + (previousUniverses - 1) * ledsPerUniverse;
}
uint16_t ledsTotal = previousLeds + (dmxChannels - dmxOffset +1) / 3;
uint16_t ledsTotal = previousLeds + (dmxChannels - dmxOffset +1) / dmxChannelsPerLed;
if (!is4Chan) {
for (uint16_t i = previousLeds; i < ledsTotal; i++) {
setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], 0);
}
} else {
for (uint16_t i = previousLeds; i < ledsTotal; i++) {
setRealtimePixel(i, e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++], e131_data[dmxOffset++]);
}
}
break;
}
default:

View File

@ -238,7 +238,8 @@ type="checkbox" name="ES"><br>DMX start address: <input name="DA" type="number"
min="0" max="510" required><br>DMX mode: <select name="DM"><option value="0">
Disabled</option><option value="1">Single RGB</option><option value="2">
Single DRGB</option><option value="3">Effect</option><option value="4">Multi RGB
</option><option value="5">Dimmer + Multi RGB</option></select><br><a
</option><option value="5">Dimmer + Multi RGB</option><option value="6">
Multi RGBW</option></select><br><a
href="https://github.com/Aircoookie/WLED/wiki/E1.31-DMX" target="_blank">
E1.31 info</a><br>Timeout: <input name="ET" type="number" min="1" max="65000"
required> ms<br>Force max brightness: <input type="checkbox" name="FB"><br>

View File

@ -13,7 +13,7 @@
#ifndef PalettesWLED_h
#define PalettesWLED_h
#define GRADIENT_PALETTE_COUNT 41
#define GRADIENT_PALETTE_COUNT 42
const byte ib_jul01_gp[] PROGMEM = {
0, 194, 1, 1,
@ -606,6 +606,30 @@ const byte Atlantica_gp[] PROGMEM = {
180, 4, 30, 114, //blue (start 191?)
255, 4, 30, 114};
// Gradient palette "temperature_gp", originally from
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/arendal/tn/temperature.png.index.html
// converted for FastLED with gammas (2.6, 2.2, 2.5)
// Size: 144 bytes of program space.
const byte temperature_gp[] PROGMEM = {
0, 1, 27,105,
14, 1, 40,127,
28, 1, 70,168,
42, 1, 92,197,
56, 1,119,221,
70, 3,130,151,
84, 23,156,149,
99, 67,182,112,
113, 121,201, 52,
127, 142,203, 11,
141, 224,223, 1,
155, 252,187, 2,
170, 247,147, 1,
184, 237, 87, 1,
198, 229, 43, 1,
226, 171, 2, 2,
240, 80, 3, 3,
255, 80, 3, 3};
// Single array of defined cpt-city color palettes.
// This will let us programmatically choose one based on
@ -652,7 +676,8 @@ const byte* const gGradientPalettes[] PROGMEM = {
Aurora_gp, //50-37 Aurora
Atlantica_gp, //51-38 Atlantica
C9_2_gp, //52-39 C9 2
C9_new_gp //53-40 C9 New
C9_new_gp, //53-40 C9 New
temperature_gp //54-41 Temperature
};
#endif

View File

@ -152,7 +152,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
t = request->arg(F("DA")).toInt();
if (t >= 0 && t <= 510) DMXAddress = t;
t = request->arg(F("DM")).toInt();
if (t >= DMX_MODE_DISABLED && t <= DMX_MODE_MULTIPLE_DRGB) DMXMode = t;
if (t >= DMX_MODE_DISABLED && t <= DMX_MODE_MULTIPLE_RGBW) DMXMode = t;
t = request->arg(F("ET")).toInt();
if (t > 99 && t <= 65000) realtimeTimeoutMs = t;
arlsForceMaxBri = request->hasArg(F("FB"));

View File

@ -123,7 +123,7 @@ void handleNotifications()
}
//receive UDP notifications
if (!udpConnected || !(receiveNotifications || receiveDirect)) return;
if (!udpConnected) return;
bool isSupp = false;
uint16_t packetSize = notifierUdp.parsePacket();
@ -156,6 +156,8 @@ void handleNotifications()
}
}
if (!(receiveNotifications || receiveDirect)) return;
//notifier and UDP realtime
if (!packetSize || packetSize > UDP_IN_MAXSIZE) return;
if (!isSupp && notifierUdp.remoteIP() == Network.localIP()) return; //don't process broadcasts we send ourselves
@ -164,7 +166,7 @@ void handleNotifications()
if (isSupp) notifier2Udp.read(udpIn, packetSize);
else notifierUdp.read(udpIn, packetSize);
//wled notifier, block if realtime packets active
//wled notifier, ignore if realtime packets active
if (udpIn[0] == 0 && !realtimeMode && receiveNotifications)
{
//ignore notification if received within a second after sending a notification ourselves
@ -223,6 +225,7 @@ void handleNotifications()
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
return;
}
if (!receiveDirect) return;
//TPM2.NET

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2012010
#define VERSION 2012020
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG