mirror of
https://github.com/wled/WLED.git
synced 2025-04-23 22:37:18 +00:00
0 FPS = unlimited
This commit is contained in:
parent
50934e6840
commit
cf1630a94a
@ -52,7 +52,7 @@
|
||||
#else
|
||||
#define MIN_SHOW_DELAY (_frametime < 16 ? 8 : 15) // legacy MIN_SHOW_DELAY - creates more idle loops, but reduces framerates
|
||||
#endif
|
||||
#define FPS_UNLIMITED 120
|
||||
#define FPS_UNLIMITED 0
|
||||
|
||||
/* each segment uses 82 bytes of SRAM memory, so if you're application fails because of
|
||||
insufficient memory, decreasing MAX_NUM_SEGMENTS may help */
|
||||
|
@ -1314,7 +1314,7 @@ void WS2812FX::service() {
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
if (elapsed < 2) return; // keep wifi alive
|
||||
if ( !_triggered && (_targetFps != FPS_UNLIMITED) && (_targetFps > 0)) {
|
||||
if ( !_triggered && (_targetFps != FPS_UNLIMITED)) {
|
||||
if (elapsed < MIN_SHOW_DELAY) return; // WLEDMM too early for service
|
||||
}
|
||||
#else // legacy
|
||||
@ -1450,9 +1450,9 @@ uint16_t WS2812FX::getFps() const {
|
||||
}
|
||||
|
||||
void WS2812FX::setTargetFps(uint8_t fps) {
|
||||
if (fps > 0 && fps <= 120) _targetFps = fps;
|
||||
_frametime = 1000 / _targetFps;
|
||||
if (fps == FPS_UNLIMITED) _frametime = 3; // unlimited mode
|
||||
if (fps <= 120) _targetFps = fps;
|
||||
if (_targetFps > 0) _frametime = 1000 / _targetFps;
|
||||
else _frametime = 3; // unlimited mode
|
||||
}
|
||||
|
||||
void WS2812FX::setMode(uint8_t segid, uint8_t m) {
|
||||
|
@ -380,6 +380,10 @@
|
||||
gId('psu').innerHTML = s;
|
||||
gId('psu2').innerHTML = s2;
|
||||
gId("json").style.display = d.Sf.IT.value==8 ? "" : "none";
|
||||
|
||||
// show/hide unlimited FPS message
|
||||
gId('fpsNone').style.display = (d.Sf.FR.value == 0) ? 'block':'none';
|
||||
gId('fpsHelp').style.display = (d.Sf.FR.value == 0)? 'none':'block';
|
||||
}
|
||||
function lastEnd(i) {
|
||||
if (i-- < 1) return 0;
|
||||
@ -870,7 +874,9 @@ Swap: <select id="xw${s}" name="XW${s}">
|
||||
<option value="2">Linear (never wrap)</option>
|
||||
<option value="3">None (not recommended)</option>
|
||||
</select><br>
|
||||
Target refresh rate: <input type="number" class="s" min="1" max="120" name="FR" required> FPS
|
||||
Target refresh rate: <input type="number" class="s" min="0" max="120" name="FR" oninput="UI()" required> FPS
|
||||
<div id="fpsHelp" style="display: block;"><i>use 0 for unlimited</i><br></div>
|
||||
<div id="fpsNone" style="color:orange; display: none;">Unlimited FPS Mode<br></div>
|
||||
<hr class="sml">
|
||||
<div id="cfg">Config template: <input type="file" name="data2" accept=".json"><button type="button" class="sml" onclick="loadCfg(d.Sf.data2)">Apply</button><br></div>
|
||||
<hr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user