mirror of
https://github.com/wled/WLED.git
synced 2025-07-18 16:26:32 +00:00
Merge branch '0_15_0' into v0.15.0-rcX
This commit is contained in:
commit
a5693fbf8d
@ -27,5 +27,8 @@
|
|||||||
"html-minifier-terser": "^7.2.0",
|
"html-minifier-terser": "^7.2.0",
|
||||||
"inliner": "^1.13.1",
|
"inliner": "^1.13.1",
|
||||||
"nodemon": "^3.1.7"
|
"nodemon": "^3.1.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,9 @@ def _create_dirs(dirs=["map", "release", "firmware"]):
|
|||||||
os.makedirs(os.path.join(OUTPUT_DIR, d), exist_ok=True)
|
os.makedirs(os.path.join(OUTPUT_DIR, d), exist_ok=True)
|
||||||
|
|
||||||
def create_release(source):
|
def create_release(source):
|
||||||
release_name = _get_cpp_define_value(env, "WLED_RELEASE_NAME").replace("\\\"", "")
|
release_name_def = _get_cpp_define_value(env, "WLED_RELEASE_NAME")
|
||||||
if release_name:
|
if release_name_def:
|
||||||
|
release_name = release_name_def.replace("\\\"", "")
|
||||||
version = _get_cpp_define_value(env, "WLED_VERSION")
|
version = _get_cpp_define_value(env, "WLED_VERSION")
|
||||||
release_file = os.path.join(OUTPUT_DIR, "release", f"WLED_{version}_{release_name}.bin")
|
release_file = os.path.join(OUTPUT_DIR, "release", f"WLED_{version}_{release_name}.bin")
|
||||||
release_gz_file = release_file + ".gz"
|
release_gz_file = release_file + ".gz"
|
||||||
|
@ -37,7 +37,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
|
|||||||
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
|
; *** To use the below defines/overrides, copy and paste each onto it's own line just below build_flags in the section above.
|
||||||
;
|
;
|
||||||
; Set a release name that may be used to distinguish required binary for flashing
|
; Set a release name that may be used to distinguish required binary for flashing
|
||||||
; -D WLED_RELEASE_NAME=ESP32_MULTI_USREMODS
|
; -D WLED_RELEASE_NAME=\"ESP32_MULTI_USREMODS\"
|
||||||
;
|
;
|
||||||
; disable specific features
|
; disable specific features
|
||||||
; -D WLED_DISABLE_OTA
|
; -D WLED_DISABLE_OTA
|
||||||
|
@ -101,6 +101,7 @@ function adoptVersionAndRepo(html) {
|
|||||||
async function minify(str, type = "plain") {
|
async function minify(str, type = "plain") {
|
||||||
const options = {
|
const options = {
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
|
conservativeCollapse: true, // preserve spaces in text
|
||||||
collapseBooleanAttributes: true,
|
collapseBooleanAttributes: true,
|
||||||
collapseInlineTagWhitespace: true,
|
collapseInlineTagWhitespace: true,
|
||||||
minifyCSS: true,
|
minifyCSS: true,
|
||||||
|
@ -3547,7 +3547,7 @@ uint16_t mode_exploding_fireworks(void)
|
|||||||
if (segs <= (strip.getMaxSegments() /4)) maxData *= 2; //ESP8266: 1024 if <= 4 segs ESP32: 2560 if <= 8 segs
|
if (segs <= (strip.getMaxSegments() /4)) maxData *= 2; //ESP8266: 1024 if <= 4 segs ESP32: 2560 if <= 8 segs
|
||||||
int maxSparks = maxData / sizeof(spark); //ESP8266: max. 21/42/85 sparks/seg, ESP32: max. 53/106/213 sparks/seg
|
int maxSparks = maxData / sizeof(spark); //ESP8266: max. 21/42/85 sparks/seg, ESP32: max. 53/106/213 sparks/seg
|
||||||
|
|
||||||
unsigned numSparks = min(2 + ((rows*cols) >> 1), maxSparks);
|
unsigned numSparks = min(5 + ((rows*cols) >> 1), maxSparks);
|
||||||
unsigned dataSize = sizeof(spark) * numSparks;
|
unsigned dataSize = sizeof(spark) * numSparks;
|
||||||
if (!SEGENV.allocateData(dataSize + sizeof(float))) return mode_static(); //allocation failed
|
if (!SEGENV.allocateData(dataSize + sizeof(float))) return mode_static(); //allocation failed
|
||||||
float *dying_gravity = reinterpret_cast<float*>(SEGENV.data + dataSize);
|
float *dying_gravity = reinterpret_cast<float*>(SEGENV.data + dataSize);
|
||||||
@ -3602,7 +3602,8 @@ uint16_t mode_exploding_fireworks(void)
|
|||||||
* Size is proportional to the height.
|
* Size is proportional to the height.
|
||||||
*/
|
*/
|
||||||
unsigned nSparks = flare->pos + random8(4);
|
unsigned nSparks = flare->pos + random8(4);
|
||||||
nSparks = constrain(nSparks, 4, numSparks);
|
nSparks = std::max(nSparks, 4U); // This is not a standard constrain; numSparks is not guaranteed to be at least 4
|
||||||
|
nSparks = std::min(nSparks, numSparks);
|
||||||
|
|
||||||
// initialize sparks
|
// initialize sparks
|
||||||
if (SEGENV.aux0 == 2) {
|
if (SEGENV.aux0 == 2) {
|
||||||
@ -4630,7 +4631,7 @@ uint16_t mode_tv_simulator(void) {
|
|||||||
|
|
||||||
return FRAMETIME;
|
return FRAMETIME;
|
||||||
}
|
}
|
||||||
static const char _data_FX_MODE_TV_SIMULATOR[] PROGMEM = "TV Simulator@!,!;;";
|
static const char _data_FX_MODE_TV_SIMULATOR[] PROGMEM = "TV Simulator@!,!;;!;01";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
11
wled00/FX.h
11
wled00/FX.h
@ -47,6 +47,15 @@
|
|||||||
#define FRAMETIME_FIXED (1000/WLED_FPS)
|
#define FRAMETIME_FIXED (1000/WLED_FPS)
|
||||||
#define FRAMETIME strip.getFrameTime()
|
#define FRAMETIME strip.getFrameTime()
|
||||||
|
|
||||||
|
// FPS calculation (can be defined as compile flag for debugging)
|
||||||
|
#ifndef FPS_CALC_AVG
|
||||||
|
#define FPS_CALC_AVG 7 // average FPS calculation over this many frames (moving average)
|
||||||
|
#endif
|
||||||
|
#ifndef FPS_MULTIPLIER
|
||||||
|
#define FPS_MULTIPLIER 1 // dev option: multiplier to get sub-frame FPS without floats
|
||||||
|
#endif
|
||||||
|
#define FPS_CALC_SHIFT 7 // bit shift for fixed point math
|
||||||
|
|
||||||
/* each segment uses 82 bytes of SRAM memory, so if you're application fails because of
|
/* each segment uses 82 bytes of SRAM memory, so if you're application fails because of
|
||||||
insufficient memory, decreasing MAX_NUM_SEGMENTS may help */
|
insufficient memory, decreasing MAX_NUM_SEGMENTS may help */
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
@ -729,7 +738,7 @@ class WS2812FX { // 96 bytes
|
|||||||
_transitionDur(750),
|
_transitionDur(750),
|
||||||
_targetFps(WLED_FPS),
|
_targetFps(WLED_FPS),
|
||||||
_frametime(FRAMETIME_FIXED),
|
_frametime(FRAMETIME_FIXED),
|
||||||
_cumulativeFps(2),
|
_cumulativeFps(50 << FPS_CALC_SHIFT),
|
||||||
_isServicing(false),
|
_isServicing(false),
|
||||||
_isOffRefreshRequired(false),
|
_isOffRefreshRequired(false),
|
||||||
_hasWhiteChannel(false),
|
_hasWhiteChannel(false),
|
||||||
|
@ -1324,7 +1324,7 @@ void WS2812FX::service() {
|
|||||||
if (nowUp > seg.next_time || _triggered || (doShow && seg.mode == FX_MODE_STATIC))
|
if (nowUp > seg.next_time || _triggered || (doShow && seg.mode == FX_MODE_STATIC))
|
||||||
{
|
{
|
||||||
doShow = true;
|
doShow = true;
|
||||||
unsigned delay = FRAMETIME;
|
unsigned frameDelay = FRAMETIME;
|
||||||
|
|
||||||
if (!seg.freeze) { //only run effect function if not frozen
|
if (!seg.freeze) { //only run effect function if not frozen
|
||||||
int oldCCT = BusManager::getSegmentCCT(); // store original CCT value (actually it is not Segment based)
|
int oldCCT = BusManager::getSegmentCCT(); // store original CCT value (actually it is not Segment based)
|
||||||
@ -1344,7 +1344,7 @@ void WS2812FX::service() {
|
|||||||
// overwritten by later effect. To enable seamless blending for every effect, additional LED buffer
|
// overwritten by later effect. To enable seamless blending for every effect, additional LED buffer
|
||||||
// would need to be allocated for each effect and then blended together for each pixel.
|
// would need to be allocated for each effect and then blended together for each pixel.
|
||||||
[[maybe_unused]] uint8_t tmpMode = seg.currentMode(); // this will return old mode while in transition
|
[[maybe_unused]] uint8_t tmpMode = seg.currentMode(); // this will return old mode while in transition
|
||||||
delay = (*_mode[seg.mode])(); // run new/current mode
|
frameDelay = (*_mode[seg.mode])(); // run new/current mode
|
||||||
#ifndef WLED_DISABLE_MODE_BLEND
|
#ifndef WLED_DISABLE_MODE_BLEND
|
||||||
if (modeBlending && seg.mode != tmpMode) {
|
if (modeBlending && seg.mode != tmpMode) {
|
||||||
Segment::tmpsegd_t _tmpSegData;
|
Segment::tmpsegd_t _tmpSegData;
|
||||||
@ -1353,16 +1353,16 @@ void WS2812FX::service() {
|
|||||||
_virtualSegmentLength = seg.virtualLength(); // update SEGLEN (mapping may have changed)
|
_virtualSegmentLength = seg.virtualLength(); // update SEGLEN (mapping may have changed)
|
||||||
unsigned d2 = (*_mode[tmpMode])(); // run old mode
|
unsigned d2 = (*_mode[tmpMode])(); // run old mode
|
||||||
seg.restoreSegenv(_tmpSegData); // restore mode state (will also update transitional state)
|
seg.restoreSegenv(_tmpSegData); // restore mode state (will also update transitional state)
|
||||||
delay = MIN(delay,d2); // use shortest delay
|
frameDelay = min(frameDelay,d2); // use shortest delay
|
||||||
Segment::modeBlend(false); // unset semaphore
|
Segment::modeBlend(false); // unset semaphore
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
seg.call++;
|
seg.call++;
|
||||||
if (seg.isInTransition() && delay > FRAMETIME) delay = FRAMETIME; // force faster updates during transition
|
if (seg.isInTransition() && frameDelay > FRAMETIME) frameDelay = FRAMETIME; // force faster updates during transition
|
||||||
BusManager::setSegmentCCT(oldCCT); // restore old CCT for ABL adjustments
|
BusManager::setSegmentCCT(oldCCT); // restore old CCT for ABL adjustments
|
||||||
}
|
}
|
||||||
|
|
||||||
seg.next_time = nowUp + delay;
|
seg.next_time = nowUp + frameDelay;
|
||||||
}
|
}
|
||||||
_segment_index++;
|
_segment_index++;
|
||||||
}
|
}
|
||||||
@ -1407,11 +1407,13 @@ void WS2812FX::show() {
|
|||||||
|
|
||||||
unsigned long showNow = millis();
|
unsigned long showNow = millis();
|
||||||
size_t diff = showNow - _lastShow;
|
size_t diff = showNow - _lastShow;
|
||||||
size_t fpsCurr = 200;
|
|
||||||
if (diff > 0) fpsCurr = 1000 / diff;
|
if (diff > 0) { // skip calculation if no time has passed
|
||||||
_cumulativeFps = (3 * _cumulativeFps + fpsCurr +2) >> 2; // "+2" for proper rounding (2/4 = 0.5)
|
size_t fpsCurr = (1000 << FPS_CALC_SHIFT) / diff; // fixed point math
|
||||||
|
_cumulativeFps = (FPS_CALC_AVG * _cumulativeFps + fpsCurr + FPS_CALC_AVG / 2) / (FPS_CALC_AVG + 1); // "+FPS_CALC_AVG/2" for proper rounding
|
||||||
_lastShow = showNow;
|
_lastShow = showNow;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a true value if any of the strips are still being updated.
|
* Returns a true value if any of the strips are still being updated.
|
||||||
@ -1427,7 +1429,7 @@ bool WS2812FX::isUpdating() const {
|
|||||||
*/
|
*/
|
||||||
uint16_t WS2812FX::getFps() const {
|
uint16_t WS2812FX::getFps() const {
|
||||||
if (millis() - _lastShow > 2000) return 0;
|
if (millis() - _lastShow > 2000) return 0;
|
||||||
return _cumulativeFps +1;
|
return (FPS_MULTIPLIER * _cumulativeFps) >> FPS_CALC_SHIFT; // _cumulativeFps is stored in fixed point
|
||||||
}
|
}
|
||||||
|
|
||||||
void WS2812FX::setTargetFps(uint8_t fps) {
|
void WS2812FX::setTargetFps(uint8_t fps) {
|
||||||
|
@ -1191,7 +1191,7 @@ bool handleSet(AsyncWebServerRequest *request, const String& req, bool apply)
|
|||||||
|
|
||||||
// internal call, does not send XML response
|
// internal call, does not send XML response
|
||||||
pos = req.indexOf(F("IN"));
|
pos = req.indexOf(F("IN"));
|
||||||
if (pos < 1) {
|
if ((request != nullptr) && (pos < 1)) {
|
||||||
auto response = request->beginResponseStream("text/xml");
|
auto response = request->beginResponseStream("text/xml");
|
||||||
XML_response(*response);
|
XML_response(*response);
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
@ -34,8 +34,8 @@ static const int enablePin = -1; // disable the enable pin because it is not ne
|
|||||||
static const int rxPin = -1; // disable the receiving pin because it is not needed - softhack007: Pin=-1 means "use default" not "disable"
|
static const int rxPin = -1; // disable the receiving pin because it is not needed - softhack007: Pin=-1 means "use default" not "disable"
|
||||||
static const int txPin = 2; // transmit DMX data over this pin (default is pin 2)
|
static const int txPin = 2; // transmit DMX data over this pin (default is pin 2)
|
||||||
|
|
||||||
//DMX value array and size. Entry 0 will hold startbyte
|
//DMX value array and size. Entry 0 will hold startbyte, so we need 512+1 elements
|
||||||
static uint8_t dmxData[dmxMaxChannel] = { 0 };
|
static uint8_t dmxData[dmxMaxChannel+1] = { 0 };
|
||||||
static int chanSize = 0;
|
static int chanSize = 0;
|
||||||
#if !defined(DMX_SEND_ONLY)
|
#if !defined(DMX_SEND_ONLY)
|
||||||
static int currentChannel = 0;
|
static int currentChannel = 0;
|
||||||
|
@ -264,12 +264,12 @@ using PSRAMDynamicJsonDocument = BasicJsonDocument<PSRAM_Allocator>;
|
|||||||
#define WLED_VERSION dev
|
#define WLED_VERSION dev
|
||||||
#endif
|
#endif
|
||||||
#ifndef WLED_RELEASE_NAME
|
#ifndef WLED_RELEASE_NAME
|
||||||
#define WLED_RELEASE_NAME dev_release
|
#define WLED_RELEASE_NAME "Custom"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Global Variable definitions
|
// Global Variable definitions
|
||||||
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
|
WLED_GLOBAL char versionString[] _INIT(TOSTRING(WLED_VERSION));
|
||||||
WLED_GLOBAL char releaseString[] _INIT(WLED_RELEASE_NAME); // somehow this will not work if using "const char releaseString[]
|
WLED_GLOBAL char releaseString[] _INIT(WLED_RELEASE_NAME); // must include the quotes when defining, e.g -D WLED_RELEASE_NAME=\"ESP32_MULTI_USREMODS\"
|
||||||
#define WLED_CODENAME "Kōsen"
|
#define WLED_CODENAME "Kōsen"
|
||||||
|
|
||||||
// AP and OTA default passwords (for maximum security change them!)
|
// AP and OTA default passwords (for maximum security change them!)
|
||||||
|
@ -465,7 +465,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
printSetFormValue(settingsScript,PSTR("MG"),mqttGroupTopic);
|
printSetFormValue(settingsScript,PSTR("MG"),mqttGroupTopic);
|
||||||
printSetFormCheckbox(settingsScript,PSTR("BM"),buttonPublishMqtt);
|
printSetFormCheckbox(settingsScript,PSTR("BM"),buttonPublishMqtt);
|
||||||
printSetFormCheckbox(settingsScript,PSTR("RT"),retainMqttMsg);
|
printSetFormCheckbox(settingsScript,PSTR("RT"),retainMqttMsg);
|
||||||
settingsScript.printf_P(PSTR("d.Sf.MD.maxlength=%d;d.Sf.MG.maxlength=%d;d.Sf.MS.maxlength=%d;"),
|
settingsScript.printf_P(PSTR("d.Sf.MD.maxLength=%d;d.Sf.MG.maxLength=%d;d.Sf.MS.maxLength=%d;"),
|
||||||
MQTT_MAX_TOPIC_LEN, MQTT_MAX_TOPIC_LEN, MQTT_MAX_SERVER_LEN);
|
MQTT_MAX_TOPIC_LEN, MQTT_MAX_TOPIC_LEN, MQTT_MAX_SERVER_LEN);
|
||||||
#else
|
#else
|
||||||
settingsScript.print(F("toggle('MQTT');")); // hide MQTT settings
|
settingsScript.print(F("toggle('MQTT');")); // hide MQTT settings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user