code spell checking - part4 (MM specific)
This commit is contained in:
@@ -733,7 +733,7 @@
|
|||||||
#### Build 2101040
|
#### Build 2101040
|
||||||
|
|
||||||
- Replaced Red & Blue effect with Aurora effect (PR #1589)
|
- Replaced Red & Blue effect with Aurora effect (PR #1589)
|
||||||
- Fixed HTTP changing segments uncommanded (#1618)
|
- Fixed HTTP changing segments un-commanded (#1618)
|
||||||
- Updated copyright year and contributor page link
|
- Updated copyright year and contributor page link
|
||||||
|
|
||||||
#### Build 2012311
|
#### Build 2012311
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ You are all set if you have enabled `Editor: Detect Indentation` in VS Code.
|
|||||||
|
|
||||||
#### Blocks
|
#### Blocks
|
||||||
|
|
||||||
Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block braches is acceptable.
|
Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block braces is acceptable.
|
||||||
|
|
||||||
Good:
|
Good:
|
||||||
```cpp
|
```cpp
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ build_flagsV4 = -g
|
|||||||
-DCONFIG_LITTLEFS_FOR_IDF_3_2 -DLFS_THREADSAFE
|
-DCONFIG_LITTLEFS_FOR_IDF_3_2 -DLFS_THREADSAFE
|
||||||
-D CONFIG_ASYNC_TCP_USE_WDT=0
|
-D CONFIG_ASYNC_TCP_USE_WDT=0
|
||||||
-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=9472 ;; WLEDMM increase stack by 1.25Kb, as audioreactive needs bigger SETTINGS_STACK_BUF_SIZE
|
-D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=9472 ;; WLEDMM increase stack by 1.25Kb, as audioreactive needs bigger SETTINGS_STACK_BUF_SIZE
|
||||||
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; mandatory for "classic ESP32" when builing with arduino-esp32 >=2.0.3
|
; -DARDUINO_USB_CDC_ON_BOOT=0 ;; mandatory for "classic ESP32" when building with arduino-esp32 >=2.0.3
|
||||||
;;; V4.4.x libraries (without LOROL_LITTLEFS; with newer NeoPixelBus)
|
;;; V4.4.x libraries (without LOROL_LITTLEFS; with newer NeoPixelBus)
|
||||||
lib_depsV4 =
|
lib_depsV4 =
|
||||||
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ;; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !!
|
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 ;; WLEDMM this must be first in the list, otherwise Aircoookie/ESPAsyncWebServer pulls in an older version of AsyncTCP !!
|
||||||
@@ -984,7 +984,7 @@ lib_deps_M =
|
|||||||
lib_deps_V4_M =
|
lib_deps_V4_M =
|
||||||
;https://github.com/blazoncek/OneWire.git ; includes bugfixes for inconsistent readings
|
;https://github.com/blazoncek/OneWire.git ; includes bugfixes for inconsistent readings
|
||||||
paulstoffregen/OneWire@ ^2.3.7 ; used for USERMOD_DALLASTEMPERATURE -> need newer release with bugfixes for -S3; still requires TEMPERATURE_PIN < 46
|
paulstoffregen/OneWire@ ^2.3.7 ; used for USERMOD_DALLASTEMPERATURE -> need newer release with bugfixes for -S3; still requires TEMPERATURE_PIN < 46
|
||||||
olikraus/U8g2@ ^2.34.5 ; used for USERMOD_FOUR_LINE_DISPLAY -> need newer version with bugfixes for arduino-esp32 v2.0.4 (Wire inititialization)
|
olikraus/U8g2@ ^2.34.5 ; used for USERMOD_FOUR_LINE_DISPLAY -> need newer version with bugfixes for arduino-esp32 v2.0.4 (Wire initialization)
|
||||||
${common_mm.animartrix_lib_deps}
|
${common_mm.animartrix_lib_deps}
|
||||||
|
|
||||||
build_flags_XL =
|
build_flags_XL =
|
||||||
@@ -992,7 +992,7 @@ build_flags_XL =
|
|||||||
-D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG)
|
-D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG)
|
||||||
-D USERMOD_GAMES ; WLEDMM usermod
|
-D USERMOD_GAMES ; WLEDMM usermod
|
||||||
-D USERMOD_BATTERY ;; enable Battery usermod
|
-D USERMOD_BATTERY ;; enable Battery usermod
|
||||||
-D USERMOD_BATTERY_USE_LIPO ;; use new "decharging curve" for LiPo cells
|
-D USERMOD_BATTERY_USE_LIPO ;; use new "discharging curve" for LiPo cells
|
||||||
-D USERMOD_BH1750
|
-D USERMOD_BH1750
|
||||||
-D USERMOD_ANIMATED_STAIRCASE
|
-D USERMOD_ANIMATED_STAIRCASE
|
||||||
-D USERMOD_RTC ;; experimental
|
-D USERMOD_RTC ;; experimental
|
||||||
@@ -1124,7 +1124,7 @@ build_flags =
|
|||||||
[Speed_Flags]
|
[Speed_Flags]
|
||||||
build_flags =
|
build_flags =
|
||||||
-O2 ;; optimize for performance instead of size
|
-O2 ;; optimize for performance instead of size
|
||||||
;-ffast-math ;; gives a few (2-5) percent sppedup on ESP32-S3, but causes slight slowdown on classic ESP32
|
;-ffast-math ;; gives a few (2-5) percent speedup on ESP32-S3, but causes slight slowdown on classic ESP32
|
||||||
-mtarget-align -free -fipa-pta ;; these are very useful, too
|
-mtarget-align -free -fipa-pta ;; these are very useful, too
|
||||||
-fno-jump-tables -fno-tree-switch-conversion ;; needed
|
-fno-jump-tables -fno-tree-switch-conversion ;; needed
|
||||||
-freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed
|
-freorder-blocks -Wwrite-strings -fstrict-volatile-bitfields ;; needed
|
||||||
@@ -1341,7 +1341,7 @@ build_flags = ${common.build_flags_esp8266}
|
|||||||
-D USERMOD_GAMES ; WLEDMM usermod
|
-D USERMOD_GAMES ; WLEDMM usermod
|
||||||
; -D USERMOD_ARTIFX ; this is compiling but not working due to low memory on 8266
|
; -D USERMOD_ARTIFX ; this is compiling but not working due to low memory on 8266
|
||||||
-D USERMOD_BATTERY ;; enable Battery usermod
|
-D USERMOD_BATTERY ;; enable Battery usermod
|
||||||
-D USERMOD_BATTERY_USE_LIPO ;; use new "decharging curve" for LiPo cells
|
-D USERMOD_BATTERY_USE_LIPO ;; use new "discharging curve" for LiPo cells
|
||||||
-D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible
|
-D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible
|
||||||
-D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868
|
-D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868
|
||||||
; -D WLED_DEBUG
|
; -D WLED_DEBUG
|
||||||
@@ -1882,7 +1882,7 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags}
|
|||||||
-D HW_PIN_SCL=35 -D HW_PIN_SDA=33
|
-D HW_PIN_SCL=35 -D HW_PIN_SDA=33
|
||||||
-D RLYPIN=9
|
-D RLYPIN=9
|
||||||
;; -D HW_PIN_MOSISPI=11 -D HW_PIN_CLOCKSPI=7 -D HW_PIN_MISOSPI=9 ;; 9 already in use for RELAY, 7 for IR
|
;; -D HW_PIN_MOSISPI=11 -D HW_PIN_CLOCKSPI=7 -D HW_PIN_MISOSPI=9 ;; 9 already in use for RELAY, 7 for IR
|
||||||
-D SR_DMTYPE=1 -D I2S_SDPIN=34 -D I2S_CKPIN=14 -D I2S_WSPIN=17 -D MCLK_PIN=-1 ;; reommended for mini shield
|
-D SR_DMTYPE=1 -D I2S_SDPIN=34 -D I2S_CKPIN=14 -D I2S_WSPIN=17 -D MCLK_PIN=-1 ;; recommended for mini shield
|
||||||
;; -D FFTTASK_PRIORITY=2 ;; useful for testing FFT timing. reduces audio latency, but makes effects slower.
|
;; -D FFTTASK_PRIORITY=2 ;; useful for testing FFT timing. reduces audio latency, but makes effects slower.
|
||||||
;; -D STATUSLED=15
|
;; -D STATUSLED=15
|
||||||
-D WLED_USE_MY_CONFIG
|
-D WLED_USE_MY_CONFIG
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ return F("DOUT");
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//******** Flash Chip Speed is NOT correctl !!!! *****
|
//******** Flash Chip Speed is NOT correct !!!! *****
|
||||||
uint32_t my_ESP_getFlashChipSpeed(void)
|
uint32_t my_ESP_getFlashChipSpeed(void)
|
||||||
{
|
{
|
||||||
const uint32_t spi_clock = REG_READ(SPI_CLOCK_REG(0));
|
const uint32_t spi_clock = REG_READ(SPI_CLOCK_REG(0));
|
||||||
@@ -413,7 +413,7 @@ void my_print_reset_reason(int reason)
|
|||||||
case 11 : Serial.print(" TGWDT_CPU_RESET");break; /**<11, Time Group reset CPU*/
|
case 11 : Serial.print(" TGWDT_CPU_RESET");break; /**<11, Time Group reset CPU*/
|
||||||
case 12 : Serial.print(" SW_CPU_RESET");break; /**<12, Software reset CPU*/
|
case 12 : Serial.print(" SW_CPU_RESET");break; /**<12, Software reset CPU*/
|
||||||
case 13 : Serial.print(" RTCWDT_CPU_RESET");break; /**<13, RTC Watch dog Reset CPU*/
|
case 13 : Serial.print(" RTCWDT_CPU_RESET");break; /**<13, RTC Watch dog Reset CPU*/
|
||||||
case 14 : Serial.print(" EXT_CPU_RESET");break; /**<14, for APP CPU, reseted by PRO CPU*/
|
case 14 : Serial.print(" EXT_CPU_RESET");break; /**<14, for APP CPU, reset by PRO CPU*/
|
||||||
case 15 : Serial.print(" RTCWDT_BROWN_OUT_RESET");break; /**<15, Reset when the vdd voltage is not stable*/
|
case 15 : Serial.print(" RTCWDT_BROWN_OUT_RESET");break; /**<15, Reset when the vdd voltage is not stable*/
|
||||||
case 16 : Serial.print(" RTCWDT_RTC_RESET");break; /**<16, RTC Watch dog reset digital core and rtc module*/
|
case 16 : Serial.print(" RTCWDT_RTC_RESET");break; /**<16, RTC Watch dog reset digital core and rtc module*/
|
||||||
case 17 : Serial.print(" TG1WDT_CPU_RESET");break; /**<17, Time Group1 reset CPU*/
|
case 17 : Serial.print(" TG1WDT_CPU_RESET");break; /**<17, Time Group1 reset CPU*/
|
||||||
@@ -452,7 +452,7 @@ void my_verbose_print_reset_reason(int reason)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parts below were created by softhack007, licended under GPL v3.0
|
* parts below were created by softhack007, licenced under GPL v3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void show_psram_info_part1(void)
|
void show_psram_info_part1(void)
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class UsermodBattery : public Usermod
|
|||||||
{
|
{
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
if ((batteryPin <0) || !pinManager.isPinAnalog(batteryPin)) return(-1.0f); // WLEDMM avoid reading from invalid pin
|
if ((batteryPin <0) || !pinManager.isPinAnalog(batteryPin)) return(-1.0f); // WLEDMM avoid reading from invalid pin
|
||||||
// use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attentuation) and divide by 1000 to get from milivolts to volts and multiply by voltage multiplier and apply calibration value
|
// use calibrated millivolts analogread on esp32 (150 mV ~ 2450 mV default attenuation) and divide by 1000 to get from milliVolts to volts and multiply by voltage multiplier and apply calibration value
|
||||||
return (analogReadMilliVolts(batteryPin) / 1000.0f) * voltageMultiplier + calibration;
|
return (analogReadMilliVolts(batteryPin) / 1000.0f) * voltageMultiplier + calibration;
|
||||||
#else
|
#else
|
||||||
// use analog read on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precision 1023 and multiply by voltage multiplier and apply calibration value
|
// use analog read on esp8266 ( 0V ~ 1V no attenuation options) and divide by ADC precision 1023 and multiply by voltage multiplier and apply calibration value
|
||||||
@@ -216,7 +216,7 @@ class UsermodBattery : public Usermod
|
|||||||
*/
|
*/
|
||||||
#ifdef USERMOD_BATTERY_USE_LIPO
|
#ifdef USERMOD_BATTERY_USE_LIPO
|
||||||
batteryLevel = mapf(voltage, minBatteryVoltage, maxBatteryVoltage, 0, 100); // basic mapping
|
batteryLevel = mapf(voltage, minBatteryVoltage, maxBatteryVoltage, 0, 100); // basic mapping
|
||||||
// LiPo batteries have a differnt dischargin curve, see
|
// LiPo batteries have a different dischargin curve, see
|
||||||
// https://blog.ampow.com/lipo-voltage-chart/
|
// https://blog.ampow.com/lipo-voltage-chart/
|
||||||
if (batteryLevel < 40.0f)
|
if (batteryLevel < 40.0f)
|
||||||
batteryLevel = mapf(batteryLevel, 0, 40, 0, 12); // last 45% -> drops very quickly
|
batteryLevel = mapf(batteryLevel, 0, 40, 0, 12); // last 45% -> drops very quickly
|
||||||
@@ -413,7 +413,7 @@ class UsermodBattery : public Usermod
|
|||||||
oappend(SET_F("addInfo('Battery:indicator:threshold', 1, '%');"));
|
oappend(SET_F("addInfo('Battery:indicator:threshold', 1, '%');"));
|
||||||
oappend(SET_F("addInfo('Battery:indicator:duration', 1, 's');"));
|
oappend(SET_F("addInfo('Battery:indicator:duration', 1, 's');"));
|
||||||
|
|
||||||
// cannot quite get this mf to work. its exeeding some buffer limit i think
|
// cannot quite get this mf to work. its exceeding some buffer limit i think
|
||||||
// what i wanted is a list of all presets to select one from
|
// what i wanted is a list of all presets to select one from
|
||||||
// oappend(SET_F("bd=addDropdown('Battery:low-power-indicator', 'preset');"));
|
// oappend(SET_F("bd=addDropdown('Battery:low-power-indicator', 'preset');"));
|
||||||
// the loop generates: oappend(SET_F("addOption(bd, 'preset name', preset id);"));
|
// the loop generates: oappend(SET_F("addOption(bd, 'preset name', preset id);"));
|
||||||
@@ -612,7 +612,7 @@ class UsermodBattery : public Usermod
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the capacity of all cells in parralel sumed up
|
* Get the capacity of all cells in parallel summed up
|
||||||
* unit: mAh
|
* unit: mAh
|
||||||
*/
|
*/
|
||||||
unsigned int getTotalBatteryCapacity()
|
unsigned int getTotalBatteryCapacity()
|
||||||
@@ -788,7 +788,7 @@ class UsermodBattery : public Usermod
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get low-power-indicator status when the indication is done thsi returns true
|
* Get low-power-indicator status when the indication is done this returns true
|
||||||
*/
|
*/
|
||||||
bool getLowPowerIndicatorDone()
|
bool getLowPowerIndicatorDone()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class PWMFanUsermod : public Usermod {
|
|||||||
pinMode(tachoPin, INPUT);
|
pinMode(tachoPin, INPUT);
|
||||||
digitalWrite(tachoPin, HIGH);
|
digitalWrite(tachoPin, HIGH);
|
||||||
attachInterrupt(digitalPinToInterrupt(tachoPin), rpm_fan, FALLING);
|
attachInterrupt(digitalPinToInterrupt(tachoPin), rpm_fan, FALLING);
|
||||||
DEBUG_PRINTLN(F("Tacho sucessfully initialized."));
|
DEBUG_PRINTLN(F("Tacho successfully initialized."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinitTacho(void) {
|
void deinitTacho(void) {
|
||||||
@@ -118,12 +118,12 @@ class PWMFanUsermod : public Usermod {
|
|||||||
if (pwmChannel == 255) { //no more free LEDC channels
|
if (pwmChannel == 255) { //no more free LEDC channels
|
||||||
deinitPWMfan(); return;
|
deinitPWMfan(); return;
|
||||||
}
|
}
|
||||||
// configure LED PWM functionalitites
|
// configure LED PWM functionalities
|
||||||
ledcSetup(pwmChannel, 25000, 8);
|
ledcSetup(pwmChannel, 25000, 8);
|
||||||
// attach the channel to the GPIO to be controlled
|
// attach the channel to the GPIO to be controlled
|
||||||
ledcAttachPin(pwmPin, pwmChannel);
|
ledcAttachPin(pwmPin, pwmChannel);
|
||||||
#endif
|
#endif
|
||||||
DEBUG_PRINTLN(F("Fan PWM sucessfully initialized."));
|
DEBUG_PRINTLN(F("Fan PWM successfully initialized."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinitPWMfan(void) {
|
void deinitPWMfan(void) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
- #define ARDUINOJSON_DEFAULT_NESTING_LIMIT 100 //set this in ArduinoJson!!!, currently not necessary...
|
- #define ARDUINOJSON_DEFAULT_NESTING_LIMIT 100 //set this in ArduinoJson!!!, currently not necessary...
|
||||||
- IF UPDATING THIS FILE IN THE WLED REPO, SEND A PULL REQUEST TO https://github.com/ewoudwijma/ARTI AS WELL!!!
|
- IF UPDATING THIS FILE IN THE WLED REPO, SEND A PULL REQUEST TO https://github.com/ewoudwijma/ARTI AS WELL!!!
|
||||||
@later
|
@later
|
||||||
- Code improvememt
|
- Code improvement
|
||||||
- See 'for some weird reason this causes a crash on esp32'
|
- See 'for some weird reason this causes a crash on esp32'
|
||||||
- check why column/lineno not correct
|
- check why column/lineno not correct
|
||||||
- Definition improvements
|
- Definition improvements
|
||||||
@@ -2181,7 +2181,7 @@ public:
|
|||||||
ERROR_ARTI("%s %s %s unknown\n", spaces+50-depth, key, variable_name);
|
ERROR_ARTI("%s %s %s unknown\n", spaces+50-depth, key, variable_name);
|
||||||
valueStack->push(floatNull);
|
valueStack->push(floatNull);
|
||||||
}
|
}
|
||||||
} // ! founnd
|
} // ! fouund
|
||||||
visitedAlready = true;
|
visitedAlready = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// For testing porposes, definitions should not only run on Arduino but also on Windows etc.
|
// For testing purposes, definitions should not only run on Arduino but also on Windows etc.
|
||||||
// Because compiling on arduino takes seriously more time than on Windows.
|
// Because compiling on arduino takes seriously more time than on Windows.
|
||||||
// The plugin.h files replace native arduino calls by windows simulated calls (e.g. setPixelColor will become printf)
|
// The plugin.h files replace native arduino calls by windows simulated calls (e.g. setPixelColor will become printf)
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ float ARTI::arti_external_function(uint8_t function, float par1, float par2, flo
|
|||||||
|
|
||||||
float halfLength = (circleLength-1)/2.0;
|
float halfLength = (circleLength-1)/2.0;
|
||||||
|
|
||||||
//calculate circle positions, round to 5 digits and then round again to cater for radians inprecision (e.g. 3.49->3.5->4)
|
//calculate circle positions, round to 5 digits and then round again to cater for radians imprecision (e.g. 3.49->3.5->4)
|
||||||
int x = round(round((sin(radians(par1)) * halfLength + halfLength) * 10)/10) + deltaWidth;
|
int x = round(round((sin(radians(par1)) * halfLength + halfLength) * 10)/10) + deltaWidth;
|
||||||
int y = round(round((halfLength - cos(radians(par1)) * halfLength) * 10)/10) + deltaHeight;
|
int y = round(round((halfLength - cos(radians(par1)) * halfLength) * 10)/10) + deltaHeight;
|
||||||
return SEGMENT.XY(x,y);
|
return SEGMENT.XY(x,y);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ function populateCEEditor(name, segID)
|
|||||||
<button class="btn infobtn btn-xs" onclick="location.href='https://mm.kno.wled.ge/moonmodules/arti-fx'" type="button">?</button><br>
|
<button class="btn infobtn btn-xs" onclick="location.href='https://mm.kno.wled.ge/moonmodules/arti-fx'" type="button">?</button><br>
|
||||||
<br><i>Compile and Run Log</i><br>
|
<br><i>Compile and Run Log</i><br>
|
||||||
<textarea class="ceTextarea" id="ceLogArea"></textarea><br>
|
<textarea class="ceTextarea" id="ceLogArea"></textarea><br>
|
||||||
<i>Run log > 3 seconds is send to Serial Ouput.</i><br>
|
<i>Run log > 3 seconds is send to Serial Output.</i><br>
|
||||||
<a href="#" onclick="downloadGHFile('HBB','presets.json',true,true);return false;" title="Download HBaas Base presets">🥚</a>
|
<a href="#" onclick="downloadGHFile('HBB','presets.json',true,true);return false;" title="Download HBaas Base presets">🥚</a>
|
||||||
<a href="#" onclick="downloadGHFile('HBE','presets.json',true,true);return false;" title="Download HBaas Effects presets">🥚</a>
|
<a href="#" onclick="downloadGHFile('HBE','presets.json',true,true);return false;" title="Download HBaas Effects presets">🥚</a>
|
||||||
<a href="#" onclick="downloadGHFile('LM','presets.json',true,true);return false;" title="Download Ledmap presets">🥚</a>`;
|
<a href="#" onclick="downloadGHFile('LM','presets.json',true,true);return false;" title="Download Ledmap presets">🥚</a>`;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ ARTI * arti;
|
|||||||
//effect function
|
//effect function
|
||||||
uint16_t mode_ARTIFX(void) {
|
uint16_t mode_ARTIFX(void) {
|
||||||
//tbd: move statics to SEGMENT.data
|
//tbd: move statics to SEGMENT.data
|
||||||
static bool succesful;
|
static bool successful;
|
||||||
static bool notEnoughHeap;
|
static bool notEnoughHeap;
|
||||||
|
|
||||||
static char previousEffect[charLength];
|
static char previousEffect[charLength];
|
||||||
@@ -46,20 +46,20 @@ uint16_t mode_ARTIFX(void) {
|
|||||||
// artiWrapper = reinterpret_cast<ArtiWrapper*>(SEGENV.data);
|
// artiWrapper = reinterpret_cast<ArtiWrapper*>(SEGENV.data);
|
||||||
arti = new ARTI();
|
arti = new ARTI();
|
||||||
|
|
||||||
succesful = arti->setup("/wledv033.json", currentEffect);
|
successful = arti->setup("/wledv033.json", currentEffect);
|
||||||
|
|
||||||
if (!succesful)
|
if (!successful)
|
||||||
ERROR_ARTI("Setup not succesful\n");
|
ERROR_ARTI("Setup not successful\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (succesful) // && SEGENV.call < 250 for each frame
|
if (successful) // && SEGENV.call < 250 for each frame
|
||||||
{
|
{
|
||||||
if (FREE_SIZE <= 20000)
|
if (FREE_SIZE <= 20000)
|
||||||
{
|
{
|
||||||
ERROR_ARTI("Not enough free heap (%u <= 30000)\n", FREE_SIZE);
|
ERROR_ARTI("Not enough free heap (%u <= 30000)\n", FREE_SIZE);
|
||||||
notEnoughHeap = true;
|
notEnoughHeap = true;
|
||||||
succesful = false;
|
successful = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -71,7 +71,7 @@ uint16_t mode_ARTIFX(void) {
|
|||||||
// previousCall = SEGENV.call;
|
// previousCall = SEGENV.call;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
succesful = arti->loop();
|
successful = arti->loop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -79,7 +79,7 @@ uint16_t mode_ARTIFX(void) {
|
|||||||
arti->closeLog();
|
arti->closeLog();
|
||||||
if (notEnoughHeap && FREE_SIZE > 20000) {
|
if (notEnoughHeap && FREE_SIZE > 20000) {
|
||||||
ERROR_ARTI("Again enough free heap, restart effect (%u > 30000)\n", FREE_SIZE);
|
ERROR_ARTI("Again enough free heap, restart effect (%u > 30000)\n", FREE_SIZE);
|
||||||
succesful = true;
|
successful = true;
|
||||||
notEnoughHeap = false;
|
notEnoughHeap = false;
|
||||||
strcpy(previousEffect, ""); // force new create
|
strcpy(previousEffect, ""); // force new create
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class mcuTemp : public Usermod
|
|||||||
private:
|
private:
|
||||||
float mcutemp = 0;
|
float mcutemp = 0;
|
||||||
|
|
||||||
// any private methods should go here (non-inline methosd should be defined out of class)
|
// any private methods should go here (non-inline method should be defined out of class)
|
||||||
void publishMqtt(const char *state, bool retain = false); // example for publishing MQTT message
|
void publishMqtt(const char *state, bool retain = false); // example for publishing MQTT message
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class MPU6050Driver : public Usermod {
|
|||||||
//INTERRUPT_PIN = -1;
|
//INTERRUPT_PIN = -1;
|
||||||
//return;
|
//return;
|
||||||
}
|
}
|
||||||
if ((INTERRUPT_PIN >= 0) && (pinManager.getPinOwner(INTERRUPT_PIN) != PinOwner::UM_IMU) // only allocate pin if we don't ownn it already
|
if ((INTERRUPT_PIN >= 0) && (pinManager.getPinOwner(INTERRUPT_PIN) != PinOwner::UM_IMU) // only allocate pin if we don't own it already
|
||||||
&& !pinManager.allocatePin(INTERRUPT_PIN, false, PinOwner::UM_IMU))
|
&& !pinManager.allocatePin(INTERRUPT_PIN, false, PinOwner::UM_IMU))
|
||||||
{
|
{
|
||||||
//enabled = false;
|
//enabled = false;
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ void FourLineDisplayUsermod::setup() {
|
|||||||
}
|
}
|
||||||
// start SPI now!
|
// start SPI now!
|
||||||
#ifdef ARDUINO_ARCH_ESP32
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
if (isHW) SPI.begin(spi_sclk, spi_miso, spi_mosi); // ESP32 - will silently fail if SPI alread active.
|
if (isHW) SPI.begin(spi_sclk, spi_miso, spi_mosi); // ESP32 - will silently fail if SPI already active.
|
||||||
#else
|
#else
|
||||||
if (isHW) SPI.begin(); // ESP8266 - SPI pins are fixed
|
if (isHW) SPI.begin(); // ESP8266 - SPI pins are fixed
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ int re_qstringCmp(const void *ap, const void *bp) {
|
|||||||
// Lowercase
|
// Lowercase
|
||||||
bVal -= 32;
|
bVal -= 32;
|
||||||
}
|
}
|
||||||
// Relly we shouldn't ever get to '\0'
|
// Really we shouldn't ever get to '\0'
|
||||||
if (aVal == '"' || bVal == '"' || aVal == '\0' || bVal == '\0') {
|
if (aVal == '"' || bVal == '"' || aVal == '\0' || bVal == '\0') {
|
||||||
// We're done. one is a substring of the other
|
// We're done. one is a substring of the other
|
||||||
// or something happenend and the quote didn't stop us.
|
// or something happenend and the quote didn't stop us.
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public:
|
|||||||
// tracking the owner tags....
|
// tracking the owner tags....
|
||||||
pinA = pinB = pinC = -1;
|
pinA = pinB = pinC = -1;
|
||||||
enabled = false;
|
enabled = false;
|
||||||
DEBUG_PRINTLN(F("Failed to alocate GPIO pins for Usermod Rotary Encoder.")); //WLEDMM add debug info
|
DEBUG_PRINTLN(F("Failed to allocate GPIO pins for Usermod Rotary Encoder.")); //WLEDMM add debug info
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ void RotaryEncoderUIUsermod::setup()
|
|||||||
// tracking the owner tags....
|
// tracking the owner tags....
|
||||||
pinA = pinB = pinC = -1;
|
pinA = pinB = pinC = -1;
|
||||||
enabled = false;
|
enabled = false;
|
||||||
DEBUG_PRINTLN(F("Failed to alocate GPIO pins for Usermod Rotary Encoder (ALT).")); //WLEDMM add debug info
|
DEBUG_PRINTLN(F("Failed to allocate GPIO pins for Usermod Rotary Encoder (ALT).")); //WLEDMM add debug info
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// #define WEATHER_DEBUG
|
// #define WEATHER_DEBUG
|
||||||
|
|
||||||
//declare weathermod global variables (always precede with weather_ (psuedo class static variables)
|
//declare weathermod global variables (always precede with weather_ (pseudo class static variables)
|
||||||
static uint32_t usermods_pushLoop = 0; //effect pushes loop to execute. might be interesting for audioreactive too
|
static uint32_t usermods_pushLoop = 0; //effect pushes loop to execute. might be interesting for audioreactive too
|
||||||
static uint8_t weather_units = 1; //config var metric (celsius) is default. (Standard=Kelvin, Imperial is Fahrenheit)
|
static uint8_t weather_units = 1; //config var metric (celsius) is default. (Standard=Kelvin, Imperial is Fahrenheit)
|
||||||
static float weather_minTemp = 0; //config var
|
static float weather_minTemp = 0; //config var
|
||||||
@@ -159,7 +159,7 @@ class WeatherUsermod : public Usermod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// return if no location or no api key (reset lastTume to force loop)
|
// return if no location or no api key (reset lastTime to force loop)
|
||||||
if (fabs(latitude) < 0.00001 && fabs(latitude) < 0.00001) {strcpy(errorMessage, PSTR("No location")); lastTime = 0; return;}
|
if (fabs(latitude) < 0.00001 && fabs(latitude) < 0.00001) {strcpy(errorMessage, PSTR("No location")); lastTime = 0; return;}
|
||||||
if (strcmp(apiKey.c_str(), "") == 0) {strcpy(errorMessage, PSTR("No api key")); lastTime = 0; return;}
|
if (strcmp(apiKey.c_str(), "") == 0) {strcpy(errorMessage, PSTR("No api key")); lastTime = 0; return;}
|
||||||
|
|
||||||
@@ -181,12 +181,12 @@ class WeatherUsermod : public Usermod {
|
|||||||
if (strcmp(errorMessage, "") == 0) {
|
if (strcmp(errorMessage, "") == 0) {
|
||||||
|
|
||||||
// https://arduinojson.org/v6/how-to/deserialize-a-very-large-document/
|
// https://arduinojson.org/v6/how-to/deserialize-a-very-large-document/
|
||||||
StaticJsonDocument<256> filter; //in practive about 128
|
StaticJsonDocument<256> filter; //in practice about 128
|
||||||
filter["list"][0]["dt"] = true;
|
filter["list"][0]["dt"] = true;
|
||||||
filter["list"][0]["main"]["temp"] = true;
|
filter["list"][0]["main"]["temp"] = true;
|
||||||
filter["city"]["name"] = true;
|
filter["city"]["name"] = true;
|
||||||
filter["city"]["country"] = true;
|
filter["city"]["country"] = true;
|
||||||
PSRAMDynamicJsonDocument weatherDoc(4096); //in practive about 2673
|
PSRAMDynamicJsonDocument weatherDoc(4096); //in practice about 2673
|
||||||
|
|
||||||
// Parse JSON object
|
// Parse JSON object
|
||||||
DeserializationError error = deserializeJson(weatherDoc, client, DeserializationOption::Filter(filter));
|
DeserializationError error = deserializeJson(weatherDoc, client, DeserializationOption::Filter(filter));
|
||||||
@@ -206,7 +206,7 @@ class WeatherUsermod : public Usermod {
|
|||||||
JsonObject weatherDocObject = weatherDoc.as<JsonObject>();
|
JsonObject weatherDocObject = weatherDoc.as<JsonObject>();
|
||||||
JsonArray list = weatherDocObject[F("list")];
|
JsonArray list = weatherDocObject[F("list")];
|
||||||
JsonObject city = weatherDocObject["city"];
|
JsonObject city = weatherDocObject["city"];
|
||||||
strcat(errorMessage, city["name"]); //api succesfull
|
strcat(errorMessage, city["name"]); //api successful
|
||||||
strcat(errorMessage, city["country"]);
|
strcat(errorMessage, city["country"]);
|
||||||
|
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
@@ -319,10 +319,10 @@ class WeatherUsermod : public Usermod {
|
|||||||
|
|
||||||
oappend(SET_F("dd=addDropdown('Weather','units');"));
|
oappend(SET_F("dd=addDropdown('Weather','units');"));
|
||||||
oappend(SET_F("addOption(dd,'Kelvin',0);"));
|
oappend(SET_F("addOption(dd,'Kelvin',0);"));
|
||||||
oappend(SET_F("addOption(dd,'Celcius',1);"));
|
oappend(SET_F("addOption(dd,'Celsius',1);"));
|
||||||
oappend(SET_F("addOption(dd,'Fahrenheit',2);"));
|
oappend(SET_F("addOption(dd,'Fahrenheit',2);"));
|
||||||
oappend(SET_F("addInfo('Weather:units',1,'<i>Set time and location in time settings</i>');"));
|
oappend(SET_F("addInfo('Weather:units',1,'<i>Set time and location in time settings</i>');"));
|
||||||
oappend(SET_F("addInfo('Weather:apiKey',1,'<i>Create acount on openweathermap.org and copy the key</i>');"));
|
oappend(SET_F("addInfo('Weather:apiKey',1,'<i>Create account on openweathermap.org and copy the key</i>');"));
|
||||||
oappend(SET_F("addInfo('Weather:minTemp',1,'<i>Changing values: Reboot to (re)load forecast</i>');"));
|
oappend(SET_F("addInfo('Weather:minTemp',1,'<i>Changing values: Reboot to (re)load forecast</i>');"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ static uint16_t triwave16(uint16_t in) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generates a tristate square wave w/ attac & decay
|
* Generates a tristate square wave w/ attack & decay
|
||||||
* @param x input value 0-255
|
* @param x input value 0-255
|
||||||
* @param pulsewidth 0-127
|
* @param pulsewidth 0-127
|
||||||
* @param attdec attack & decay, max. pulsewidth / 2
|
* @param attdec attack & decay, max. pulsewidth / 2
|
||||||
@@ -3016,7 +3016,7 @@ static uint16_t rolling_balls(void) {
|
|||||||
if (SEGMENT.check1) {
|
if (SEGMENT.check1) {
|
||||||
for (int j = i+1; j < numBalls; j++) {
|
for (int j = i+1; j < numBalls; j++) {
|
||||||
if (balls[j].velocity != balls[i].velocity) {
|
if (balls[j].velocity != balls[i].velocity) {
|
||||||
// tcollided + balls[j].lastBounceUpdate is acutal time of collision (this keeps precision with long to float conversions)
|
// tcollided + balls[j].lastBounceUpdate is actual time of collision (this keeps precision with long to float conversions)
|
||||||
float tcollided = (cfac*(balls[i].height - balls[j].height) +
|
float tcollided = (cfac*(balls[i].height - balls[j].height) +
|
||||||
balls[i].velocity*float(balls[j].lastBounceUpdate - balls[i].lastBounceUpdate))/(balls[j].velocity - balls[i].velocity);
|
balls[i].velocity*float(balls[j].lastBounceUpdate - balls[i].lastBounceUpdate))/(balls[j].velocity - balls[i].velocity);
|
||||||
|
|
||||||
@@ -5148,7 +5148,7 @@ uint16_t mode_2Dgameoflife(void) { // Written by Ewoud Wijma, inspired by https:
|
|||||||
bool repetition = false;
|
bool repetition = false;
|
||||||
for (int i=0; i<crcBufferLen && !repetition; i++) repetition = (crc == crcBuffer[i]); // (Ewowi)
|
for (int i=0; i<crcBufferLen && !repetition; i++) repetition = (crc == crcBuffer[i]); // (Ewowi)
|
||||||
// same CRC would mean image did not change or was repeating itself
|
// same CRC would mean image did not change or was repeating itself
|
||||||
// -> softhack007: not exacly. Different CRC means diferent image; same CRC means nothing (could be same or slightly different).
|
// -> softhack007: not exacly. Different CRC means different image; same CRC means nothing (could be same or slightly different).
|
||||||
if (!repetition) SEGENV.step = strip.now; //if no repetition avoid reset
|
if (!repetition) SEGENV.step = strip.now; //if no repetition avoid reset
|
||||||
// remember CRCs across frames
|
// remember CRCs across frames
|
||||||
crcBuffer[SEGENV.aux0] = crc;
|
crcBuffer[SEGENV.aux0] = crc;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void WS2812FX::setUpMatrix() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// safety check
|
// safety check
|
||||||
// WLEDMM no chech on Segment::maxWidth * Segment::maxHeight > MAX_LEDS ||
|
// WLEDMM no check on Segment::maxWidth * Segment::maxHeight > MAX_LEDS ||
|
||||||
if (Segment::maxWidth <= 1 || Segment::maxHeight <= 1) {
|
if (Segment::maxWidth <= 1 || Segment::maxHeight <= 1) {
|
||||||
DEBUG_PRINTF("2D Bounds error. %d x %d\n", Segment::maxWidth, Segment::maxHeight);
|
DEBUG_PRINTF("2D Bounds error. %d x %d\n", Segment::maxWidth, Segment::maxHeight);
|
||||||
isMatrix = false;
|
isMatrix = false;
|
||||||
@@ -173,7 +173,7 @@ void WS2812FX::setUpMatrix() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// absolute matrix version of setPixelColor()
|
// absolute matrix version of setPixelColor()
|
||||||
void IRAM_ATTR_YN WS2812FX::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
|
void IRAM_ATTR_YN WS2812FX::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionally
|
||||||
{
|
{
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
if (!isMatrix) return; // not a matrix set-up
|
if (!isMatrix) return; // not a matrix set-up
|
||||||
@@ -207,7 +207,7 @@ uint32_t WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) {
|
|||||||
// XY(x,y) - gets pixel index within current segment (often used to reference leds[] array element)
|
// XY(x,y) - gets pixel index within current segment (often used to reference leds[] array element)
|
||||||
// WLEDMM Segment::XY()is declared inline, see FX.h
|
// WLEDMM Segment::XY()is declared inline, see FX.h
|
||||||
|
|
||||||
void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
|
void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: IRAM_ATTR conditionally
|
||||||
{
|
{
|
||||||
if (Segment::maxHeight==1) return; // not a matrix set-up
|
if (Segment::maxHeight==1) return; // not a matrix set-up
|
||||||
if (x >= virtualWidth() || y >= virtualHeight() || x<0 || y<0) return; // if pixel would fall out of virtual segment just exit
|
if (x >= virtualWidth() || y >= virtualHeight() || x<0 || y<0) return; // if pixel would fall out of virtual segment just exit
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ Segment::Segment(Segment &&orig) noexcept {
|
|||||||
orig.jMap = nullptr; //WLEDMM jMap
|
orig.jMap = nullptr; //WLEDMM jMap
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy assignment --> overwrite segment withg orig - deletes old buffers in "this", but does not change orig!
|
// copy assignment --> overwrite segment with orig - deletes old buffers in "this", but does not change orig!
|
||||||
Segment& Segment::operator= (const Segment &orig) {
|
Segment& Segment::operator= (const Segment &orig) {
|
||||||
DEBUG_PRINTLN(F("-- Copy-assignment segment --"));
|
DEBUG_PRINTLN(F("-- Copy-assignment segment --"));
|
||||||
if (this != &orig) {
|
if (this != &orig) {
|
||||||
@@ -833,7 +833,7 @@ void xyFromBlock(uint16_t &x,uint16_t &y, uint16_t i, uint16_t vW, uint16_t vH,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDMM: IRAM_ATTR conditionaly
|
void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDMM: IRAM_ATTR conditionally
|
||||||
{
|
{
|
||||||
if (!isActive()) return; // not active
|
if (!isActive()) return; // not active
|
||||||
#ifndef WLED_DISABLE_2D
|
#ifndef WLED_DISABLE_2D
|
||||||
@@ -942,7 +942,7 @@ void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDMM: IRAM_ATT
|
|||||||
|
|
||||||
uint16_t len = length();
|
uint16_t len = length();
|
||||||
uint8_t _bri_t = currentBri(on ? opacity : 0);
|
uint8_t _bri_t = currentBri(on ? opacity : 0);
|
||||||
if (!_bri_t && !transitional && fadeTransition) return; // if _bri_t == 0 && segment is not transitionig && transitions are enabled then save a few CPU cycles
|
if (!_bri_t && !transitional && fadeTransition) return; // if _bri_t == 0 && segment is not transitioning && transitions are enabled then save a few CPU cycles
|
||||||
if (_bri_t < 255) {
|
if (_bri_t < 255) {
|
||||||
byte r = scale8(R(col), _bri_t);
|
byte r = scale8(R(col), _bri_t);
|
||||||
byte g = scale8(G(col), _bri_t);
|
byte g = scale8(G(col), _bri_t);
|
||||||
@@ -1223,7 +1223,7 @@ void Segment::fade_out(uint8_t rate) {
|
|||||||
int g1 = G(color);
|
int g1 = G(color);
|
||||||
int b1 = B(color);
|
int b1 = B(color);
|
||||||
|
|
||||||
int wdelta = mappedRate_r * (w2 - w1); // WLEDMM use receprocal - its faster
|
int wdelta = mappedRate_r * (w2 - w1); // WLEDMM use reciprocal - its faster
|
||||||
int rdelta = mappedRate_r * (r2 - r1);
|
int rdelta = mappedRate_r * (r2 - r1);
|
||||||
int gdelta = mappedRate_r * (g2 - g1);
|
int gdelta = mappedRate_r * (g2 - g1);
|
||||||
int bdelta = mappedRate_r * (b2 - b1);
|
int bdelta = mappedRate_r * (b2 - b1);
|
||||||
@@ -1502,7 +1502,7 @@ void WS2812FX::enumerateLedmaps() {
|
|||||||
void WS2812FX::finalizeInit(void)
|
void WS2812FX::finalizeInit(void)
|
||||||
{
|
{
|
||||||
//reset segment runtimes
|
//reset segment runtimes
|
||||||
suspendStripService = true; // WELDMM avoid running effects on an incomplete strip
|
suspendStripService = true; // WLEDMM avoid running effects on an incomplete strip
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
seg.markForReset();
|
seg.markForReset();
|
||||||
seg.resetIfRequired();
|
seg.resetIfRequired();
|
||||||
@@ -1583,11 +1583,11 @@ void WS2812FX::finalizeInit(void)
|
|||||||
DEBUG_PRINTLN(F("Loading custom ledmaps"));
|
DEBUG_PRINTLN(F("Loading custom ledmaps"));
|
||||||
deserializeMap(); // (re)load default ledmap
|
deserializeMap(); // (re)load default ledmap
|
||||||
_isServicing = false; // WLEDMM
|
_isServicing = false; // WLEDMM
|
||||||
suspendStripService = false; // WELDMM ready, run !
|
suspendStripService = false; // WLEDMM ready, run !
|
||||||
}
|
}
|
||||||
|
|
||||||
// WLEDMM wait until strip is idle (=not servicing).
|
// WLEDMM wait until strip is idle (=not servicing).
|
||||||
// on 8266 this function does nothing, because we can only do "buisy waiting" on ESP32
|
// on 8266 this function does nothing, because we can only do "busy waiting" on ESP32
|
||||||
#define MAX_IDLE_WAIT_MS 50 // seems to work in most cases
|
#define MAX_IDLE_WAIT_MS 50 // seems to work in most cases
|
||||||
void WS2812FX::waitUntilIdle(void) {
|
void WS2812FX::waitUntilIdle(void) {
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_PROTECT_SERVICE)
|
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_PROTECT_SERVICE)
|
||||||
@@ -1755,7 +1755,7 @@ void WS2812FX::estimateCurrentAndLimitBri() {
|
|||||||
uint8_t scaleB = (scaleI > 255) ? 255 : scaleI;
|
uint8_t scaleB = (scaleI > 255) ? 255 : scaleI;
|
||||||
uint8_t newBri = scale8(_brightness, scaleB);
|
uint8_t newBri = scale8(_brightness, scaleB);
|
||||||
// to keep brightness uniform, sets virtual busses too - softhack007: apply reductions immediately
|
// to keep brightness uniform, sets virtual busses too - softhack007: apply reductions immediately
|
||||||
if (scaleB < 255) busses.setBrightness(scaleB, true); // NPB-LG has already applied brightness, so its suffifient to post-apply scaling ==> use scaleB instead of newBri
|
if (scaleB < 255) busses.setBrightness(scaleB, true); // NPB-LG has already applied brightness, so its sufficient to post-apply scaling ==> use scaleB instead of newBri
|
||||||
busses.setBrightness(newBri, false); // set new brightness for next frame
|
busses.setBrightness(newBri, false); // set new brightness for next frame
|
||||||
//currentMilliamps = (powerSum0 * newBri) / puPerMilliamp; // for NPBrightnessBus
|
//currentMilliamps = (powerSum0 * newBri) / puPerMilliamp; // for NPBrightnessBus
|
||||||
currentMilliamps = (powerSum0 * scaleB) / puPerMilliamp; // for NPBus-LG
|
currentMilliamps = (powerSum0 * scaleB) / puPerMilliamp; // for NPBus-LG
|
||||||
@@ -1787,7 +1787,7 @@ void WS2812FX::show(void) {
|
|||||||
if (diff > 0) fpsCurr = 1000 / diff;
|
if (diff > 0) fpsCurr = 1000 / diff;
|
||||||
_cumulativeFps = (3 * _cumulativeFps + fpsCurr +2) >> 2; // "+2" for proper rounding (2/4 = 0.5)
|
_cumulativeFps = (3 * _cumulativeFps + fpsCurr +2) >> 2; // "+2" for proper rounding (2/4 = 0.5)
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_FASTPATH)
|
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_FASTPATH)
|
||||||
_lastShow = b4show; // WLEDMM this is more accurate, however it also icreases CPU load - strip.service will run more frequently
|
_lastShow = b4show; // WLEDMM this is more accurate, however it also increases CPU load - strip.service will run more frequently
|
||||||
#else
|
#else
|
||||||
_lastShow = now;
|
_lastShow = now;
|
||||||
#endif
|
#endif
|
||||||
@@ -2234,7 +2234,7 @@ bool WS2812FX::deserializeMap(uint8_t n) {
|
|||||||
if (n) sprintf(fileName +7, "%d", n); //WLEDMM: trick to not include 0 in ledmap.json
|
if (n) sprintf(fileName +7, "%d", n); //WLEDMM: trick to not include 0 in ledmap.json
|
||||||
strcat(fileName, ".json");
|
strcat(fileName, ".json");
|
||||||
isFile = WLED_FS.exists(fileName);
|
isFile = WLED_FS.exists(fileName);
|
||||||
} else { //WLEDM add segment name as ledmap.name
|
} else { //WLEDMM add segment name as ledmap.name
|
||||||
uint8_t segment_index = 0;
|
uint8_t segment_index = 0;
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
if (n == 10 + segment_index && !isFile && seg.name != nullptr) {
|
if (n == 10 + segment_index && !isFile && seg.name != nullptr) {
|
||||||
@@ -2248,7 +2248,7 @@ bool WS2812FX::deserializeMap(uint8_t n) {
|
|||||||
|
|
||||||
if (!isFile) {
|
if (!isFile) {
|
||||||
// erase custom mapping if selecting nonexistent ledmap.json (n==0)
|
// erase custom mapping if selecting nonexistent ledmap.json (n==0)
|
||||||
//WLEDM: doubt this is necessary as return false causes setupMatrix to deal with this !!!!
|
//WLEDMM: doubt this is necessary as return false causes setupMatrix to deal with this !!!!
|
||||||
if (!isMatrix && !n) {
|
if (!isMatrix && !n) {
|
||||||
customMappingSize = 0;
|
customMappingSize = 0;
|
||||||
loadedLedmap = 0; //WLEDMM
|
loadedLedmap = 0; //WLEDMM
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
JsonObject light = doc[F("light")];
|
JsonObject light = doc[F("light")];
|
||||||
byte prev; //WLEDMM
|
byte prev; //WLEDMM
|
||||||
int tdd; //WLEDMM
|
int tdd; //WLEDMM
|
||||||
if (!light.isNull()) { //WLEDMM: in case cfg string does not contain light! (solves issue that somethimes gamma correction dissappears)
|
if (!light.isNull()) { //WLEDMM: in case cfg string does not contain light! (solves issue that sometimes gamma correction dissappears)
|
||||||
CJSON(briMultiplier, light[F("scale-bri")]);
|
CJSON(briMultiplier, light[F("scale-bri")]);
|
||||||
CJSON(strip.paletteBlend, light[F("pal-mode")]);
|
CJSON(strip.paletteBlend, light[F("pal-mode")]);
|
||||||
CJSON(autoSegments, light[F("aseg")]);
|
CJSON(autoSegments, light[F("aseg")]);
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ static byte gammaT[256] = {
|
|||||||
// experimental
|
// experimental
|
||||||
// CIE 1931 lookup table (8bit->8bit) that was proposed during discussion of issue #2767
|
// CIE 1931 lookup table (8bit->8bit) that was proposed during discussion of issue #2767
|
||||||
// https://github.com/Aircoookie/WLED/issues/2767#issuecomment-1310961308
|
// https://github.com/Aircoookie/WLED/issues/2767#issuecomment-1310961308
|
||||||
// unfortunately NepixelsBu has its own internal table, that kills low brightness values similar to the original WLED table.
|
// unfortunately NeoPixelBus has its own internal table, that kills low brightness values similar to the original WLED table.
|
||||||
// see https://github.com/Makuna/NeoPixelBus/blob/master/src/internal/NeoGamma.h
|
// see https://github.com/Makuna/NeoPixelBus/blob/master/src/internal/NeoGamma.h
|
||||||
static const byte gammaT[256] = {
|
static const byte gammaT[256] = {
|
||||||
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
|
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
|
||||||
|
|||||||
@@ -1384,7 +1384,7 @@ function toggleBubble(e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// updates segment length upon input of segment values
|
// updates segment length upon input of segment values
|
||||||
function updateLen(s, draw=true) //WLEDMM conditonally draw segment view
|
function updateLen(s, draw=true) //WLEDMM conditionally draw segment view
|
||||||
{
|
{
|
||||||
if (!gId(`seg${s}s`)) return;
|
if (!gId(`seg${s}s`)) return;
|
||||||
var start = parseInt(gId(`seg${s}s`).value);
|
var start = parseInt(gId(`seg${s}s`).value);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function peek(c) {
|
|||||||
let mW = leds[2]; // matrix width
|
let mW = leds[2]; // matrix width
|
||||||
let mH = leds[3]; // matrix height
|
let mH = leds[3]; // matrix height
|
||||||
let pPL = Math.min(c.width / mW, c.height / mH); // pixels per LED (width of circle)
|
let pPL = Math.min(c.width / mW, c.height / mH); // pixels per LED (width of circle)
|
||||||
let lOf = Math.floor((c.width - pPL*mW)/2); //left offeset (to center matrix)
|
let lOf = Math.floor((c.width - pPL*mW)/2); //left offset (to center matrix)
|
||||||
var i = 4; //same offset as in ws.cpp
|
var i = 4; //same offset as in ws.cpp
|
||||||
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
|
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
|
||||||
function colorAmp(color) {
|
function colorAmp(color) {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
<span id="lssuc" style="color:green; display:none">✔ Configuration saved!</span>
|
<span id="lssuc" style="color:green; display:none">✔ Configuration saved!</span>
|
||||||
<span id="lserr" style="color:red; display:none">⚠ Could not load configuration.</span>
|
<span id="lserr" style="color:red; display:none">⚠ Could not load configuration.</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- WLEDMM: no gpios here as it is generated -->
|
<!-- WLEDMM: no GPIOs here as it is generated -->
|
||||||
<div id="um">Loading settings...</div>
|
<div id="um">Loading settings...</div>
|
||||||
<div name="errorMessage"></div>
|
<div name="errorMessage"></div>
|
||||||
<hr><button type="button" onclick="B()">Back</button><button type="submit">Save</button>
|
<hr><button type="button" onclick="B()">Back</button><button type="submit">Save</button>
|
||||||
|
|||||||
@@ -1051,7 +1051,7 @@ void serializeInfo(JsonObject root)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(WLED_DEBUG) || defined(WLED_DEBUG_HOST) || defined(SR_DEBUG) || defined(SR_STATS)
|
#if defined(WLED_DEBUG) || defined(WLED_DEBUG_HOST) || defined(SR_DEBUG) || defined(SR_STATS)
|
||||||
// WLEDMM add status of Serial, incuding pin alloc
|
// WLEDMM add status of Serial, including pin alloc
|
||||||
root[F("serialOnline")] = Serial ? (canUseSerial()?F("Serial ready ☾"):F("Serial in use ☾")) : F("Serial disconected ☾"); // "Disconnected" may happen on boards with USB CDC
|
root[F("serialOnline")] = Serial ? (canUseSerial()?F("Serial ready ☾"):F("Serial in use ☾")) : F("Serial disconected ☾"); // "Disconnected" may happen on boards with USB CDC
|
||||||
root[F("sRX")] = pinManager.isPinAllocated(hardwareRX) ? pinManager.getPinOwnerText(hardwareRX): F("free");
|
root[F("sRX")] = pinManager.isPinAllocated(hardwareRX) ? pinManager.getPinOwnerText(hardwareRX): F("free");
|
||||||
root[F("sTX")] = pinManager.isPinAllocated(hardwareTX) ? pinManager.getPinOwnerText(hardwareTX): F("free");
|
root[F("sTX")] = pinManager.isPinAllocated(hardwareTX) ? pinManager.getPinOwnerText(hardwareTX): F("free");
|
||||||
@@ -1330,7 +1330,7 @@ void serializeModeData(JsonArray fxdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// deserializes mode names string into JsonArray
|
// deserializes mode names string into JsonArray
|
||||||
// also removes effect data extensions (@...) from deserialised names
|
// also removes effect data extensions (@...) from deserialized names
|
||||||
void serializeModeNames(JsonArray arr) {
|
void serializeModeNames(JsonArray arr) {
|
||||||
char lineBuffer[128];
|
char lineBuffer[128];
|
||||||
for (size_t i = 0; i < strip.getModeCount(); i++) {
|
for (size_t i = 0; i < strip.getModeCount(); i++) {
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ void handleNightlight()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//utility for FastLED to use our custom timer
|
//utility for FastLED to use our custom timer
|
||||||
uint32_t __attribute__((pure)) get_millisecond_timer() // WLEDMM attribute pure = does not write other momory
|
uint32_t __attribute__((pure)) get_millisecond_timer() // WLEDMM attribute pure = does not write other memory
|
||||||
{
|
{
|
||||||
return strip.now;
|
return strip.now;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "wled.h"
|
#include "wled.h"
|
||||||
|
|
||||||
#ifdef WLED_DEBUG_HOST //WLEDMM: this looks unnecesarry as .h is not included anyway if no netdebug
|
#ifdef WLED_DEBUG_HOST //WLEDMM: this looks unnecessary as .h is not included anyway if no netdebug
|
||||||
|
|
||||||
size_t NetworkDebugPrinter::write(uint8_t c) {
|
size_t NetworkDebugPrinter::write(uint8_t c) {
|
||||||
if (!WLED_CONNECTED || !netDebugEnabled) return 0;
|
if (!WLED_CONNECTED || !netDebugEnabled) return 0;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ String PinManagerClass::getOwnerText(PinOwner tag) {
|
|||||||
case PinOwner::HW_I2C : return(F("I2C (hw)")); break; // 'I2C' == hardware I2C pins (4&5 on ESP8266, 21&22 on ESP32)
|
case PinOwner::HW_I2C : return(F("I2C (hw)")); break; // 'I2C' == hardware I2C pins (4&5 on ESP8266, 21&22 on ESP32)
|
||||||
case PinOwner::HW_SPI : return(F("SPI (hw)")); break; // 'SPI' == hardware (V)SPI pins (13,14&15 on ESP8266, 5,18&23 on ESP32)
|
case PinOwner::HW_SPI : return(F("SPI (hw)")); break; // 'SPI' == hardware (V)SPI pins (13,14&15 on ESP8266, 5,18&23 on ESP32)
|
||||||
|
|
||||||
case PinOwner::UM_Audioreactive : return(F("AudioReactive (UM)")); break; // audioreative usermod - analog or digital audio input
|
case PinOwner::UM_Audioreactive : return(F("AudioReactive (UM)")); break; // audioreactive usermod - analog or digital audio input
|
||||||
case PinOwner::UM_Temperature : return(F("Temperature (UM)")); break; // "usermod_temperature.h"
|
case PinOwner::UM_Temperature : return(F("Temperature (UM)")); break; // "usermod_temperature.h"
|
||||||
case PinOwner::UM_PIR : return(F("PIR (UM)")); break; // "usermod_PIR_sensor_switch.h"
|
case PinOwner::UM_PIR : return(F("PIR (UM)")); break; // "usermod_PIR_sensor_switch.h"
|
||||||
case PinOwner::UM_IMU : return(F("IMU mpu6050 (UM)")); break; // "usermod_mpu6050_imu.h"
|
case PinOwner::UM_IMU : return(F("IMU mpu6050 (UM)")); break; // "usermod_mpu6050_imu.h"
|
||||||
@@ -72,7 +72,7 @@ String PinManagerClass::getPinSpecialText(int gpio) { // special purpose PIN in
|
|||||||
if ((gpio == 0xFF) || (gpio < 0)) return(F("")); // explicitly allow -1 as a no-op
|
if ((gpio == 0xFF) || (gpio < 0)) return(F("")); // explicitly allow -1 as a no-op
|
||||||
|
|
||||||
#ifdef USERMOD_AUDIOREACTIVE
|
#ifdef USERMOD_AUDIOREACTIVE
|
||||||
// audioreactive settings - unfortunately, these are hiddden inside usermod now :-(
|
// audioreactive settings - unfortunately, these are hidden inside usermod now :-(
|
||||||
// if((gpio == audioPin) && (dmType == 0)) return(F("analog audio in"));
|
// if((gpio == audioPin) && (dmType == 0)) return(F("analog audio in"));
|
||||||
// if((gpio == i2ssdPin) && (dmType > 0)) return(F("I2S SD"));
|
// if((gpio == i2ssdPin) && (dmType > 0)) return(F("I2S SD"));
|
||||||
// if((gpio == i2swsPin) && (dmType > 0)) return(F("I2S WS"));
|
// if((gpio == i2swsPin) && (dmType > 0)) return(F("I2S WS"));
|
||||||
@@ -272,7 +272,7 @@ String PinManagerClass::getPinConflicts(int gpio) {
|
|||||||
|
|
||||||
if ((ownerConflict[gpio] == PinOwner::None) || (ownerTag[gpio] == ownerConflict[gpio])) { // no conflict, or "fake" conflict with current owner
|
if ((ownerConflict[gpio] == PinOwner::None) || (ownerTag[gpio] == ownerConflict[gpio])) { // no conflict, or "fake" conflict with current owner
|
||||||
return(F("")); // no conflict fot this GPIO
|
return(F("")); // no conflict fot this GPIO
|
||||||
} else { // found previous conflic!
|
} else { // found previous conflict!
|
||||||
return String("!! Conflict with ") + getOwnerText(ownerConflict[gpio]) + String(" !!");
|
return String("!! Conflict with ") + getOwnerText(ownerConflict[gpio]) + String(" !!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
i2c_scl = hw_scl_pin;
|
i2c_scl = hw_scl_pin;
|
||||||
DEBUG_PRINTF("handleSettingsSet(): reserved I2C pins SDA=%d SCL=%d.\n", i2c_sda, i2c_scl);
|
DEBUG_PRINTF("handleSettingsSet(): reserved I2C pins SDA=%d SCL=%d.\n", i2c_sda, i2c_scl);
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
Wire.setPins(i2c_sda, i2c_scl); // this will fail if Wire is initilised (Wire.begin() called)
|
Wire.setPins(i2c_sda, i2c_scl); // this will fail if Wire is initialised (Wire.begin() called)
|
||||||
#endif
|
#endif
|
||||||
// Wire.begin(); // WLEDMM moved into pinManager
|
// Wire.begin(); // WLEDMM moved into pinManager
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -149,13 +149,13 @@ bool oappend(const char* txt)
|
|||||||
{
|
{
|
||||||
uint16_t len = strlen(txt);
|
uint16_t len = strlen(txt);
|
||||||
if ((obuf == nullptr) || (olen + len >= SETTINGS_STACK_BUF_SIZE)) { // sanity checks
|
if ((obuf == nullptr) || (olen + len >= SETTINGS_STACK_BUF_SIZE)) { // sanity checks
|
||||||
if (obuf == nullptr) { USER_PRINTLN(F("oappend() error: obuf == nullptr."));
|
if (obuf == nullptr) { USER_PRINTLN(F("oappend() error: obuf == nullptr."));
|
||||||
} else {
|
} else {
|
||||||
USER_PRINT(F("oappend() error: buffer full. Increase SETTINGS_STACK_BUF_SIZE for "));
|
USER_PRINT(F("oappend() error: buffer full. Increase SETTINGS_STACK_BUF_SIZE for "));
|
||||||
USER_PRINTF("%2u bytes \t\"", len /*1 + olen + len - SETTINGS_STACK_BUF_SIZE*/);
|
USER_PRINTF("%2u bytes \t\"", len /*1 + olen + len - SETTINGS_STACK_BUF_SIZE*/);
|
||||||
USER_PRINT(txt);
|
USER_PRINT(txt);
|
||||||
USER_PRINTLN(F("\""));
|
USER_PRINTLN(F("\""));
|
||||||
}
|
}
|
||||||
return false; // buffer full
|
return false; // buffer full
|
||||||
}
|
}
|
||||||
strcpy(obuf + olen, txt);
|
strcpy(obuf + olen, txt);
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ void WLED::loop()
|
|||||||
#endif
|
#endif
|
||||||
if (!offMode || strip.isOffRefreshRequired()) {
|
if (!offMode || strip.isOffRefreshRequired()) {
|
||||||
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_PROTECT_SERVICE) // WLEDMM experimental
|
#if defined(ARDUINO_ARCH_ESP32) && defined(WLEDMM_PROTECT_SERVICE) // WLEDMM experimental
|
||||||
static unsigned long lastTimeService = 0; // WLEMM needed to remove stale lock
|
static unsigned long lastTimeService = 0; // WLEDMM needed to remove stale lock
|
||||||
if (!suspendStripService && !doInitBusses && !loadLedmap) { // WLEDMM prevent effect drawing while strip or segments are being updated
|
if (!suspendStripService && !doInitBusses && !loadLedmap) { // WLEDMM prevent effect drawing while strip or segments are being updated
|
||||||
#endif
|
#endif
|
||||||
strip.service();
|
strip.service();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2312130
|
#define VERSION 2312150
|
||||||
|
|
||||||
//WLEDMM + Moustachauve/Wled-Native
|
//WLEDMM + Moustachauve/Wled-Native
|
||||||
// You can define custom product info from build flags.
|
// You can define custom product info from build flags.
|
||||||
@@ -555,7 +555,7 @@ WLED_GLOBAL byte lastRandomIndex _INIT(0); // used to save last random co
|
|||||||
|
|
||||||
// transitions
|
// transitions
|
||||||
WLED_GLOBAL bool transitionActive _INIT(false);
|
WLED_GLOBAL bool transitionActive _INIT(false);
|
||||||
WLED_GLOBAL uint16_t transitionDelayDefault _INIT(transitionDelay); // default transition time (storec in cfg.json)
|
WLED_GLOBAL uint16_t transitionDelayDefault _INIT(transitionDelay); // default transition time (stored in cfg.json)
|
||||||
WLED_GLOBAL uint16_t transitionDelayTemp _INIT(transitionDelay); // actual transition duration (overrides transitionDelay in certain cases)
|
WLED_GLOBAL uint16_t transitionDelayTemp _INIT(transitionDelay); // actual transition duration (overrides transitionDelay in certain cases)
|
||||||
WLED_GLOBAL unsigned long transitionStartTime;
|
WLED_GLOBAL unsigned long transitionStartTime;
|
||||||
WLED_GLOBAL float tperLast _INIT(0.0f); // crossfade transition progress, 0.0f - 1.0f
|
WLED_GLOBAL float tperLast _INIT(0.0f); // crossfade transition progress, 0.0f - 1.0f
|
||||||
@@ -733,7 +733,7 @@ WLED_GLOBAL bool e131NewData _INIT(false);
|
|||||||
WLED_GLOBAL BusManager busses _INIT(BusManager());
|
WLED_GLOBAL BusManager busses _INIT(BusManager());
|
||||||
WLED_GLOBAL WS2812FX strip _INIT(WS2812FX());
|
WLED_GLOBAL WS2812FX strip _INIT(WS2812FX());
|
||||||
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES+WLED_MIN_VIRTUAL_BUSSES] _INIT({nullptr}); //temporary, to remember values from network callback until after
|
WLED_GLOBAL BusConfig* busConfigs[WLED_MAX_BUSSES+WLED_MIN_VIRTUAL_BUSSES] _INIT({nullptr}); //temporary, to remember values from network callback until after
|
||||||
// WLEDMM a few "poor man's" mutal exclusion (mutex) flags, because there are not mutex objects on 8266.
|
// WLEDMM a few "poor man's" mutual exclusion (mutex) flags, because there are not mutex objects on 8266.
|
||||||
WLED_GLOBAL volatile bool doInitBusses _INIT(false); // WLEDMM "volatile" added - needed as we want to sync parallel tasks
|
WLED_GLOBAL volatile bool doInitBusses _INIT(false); // WLEDMM "volatile" added - needed as we want to sync parallel tasks
|
||||||
WLED_GLOBAL volatile bool loadLedmap _INIT(false); // WLEDMM use as bool and use loadedLedmap for Nr
|
WLED_GLOBAL volatile bool loadLedmap _INIT(false); // WLEDMM use as bool and use loadedLedmap for Nr
|
||||||
WLED_GLOBAL volatile uint8_t loadedLedmap _INIT(0); // WLEDMM default 0
|
WLED_GLOBAL volatile uint8_t loadedLedmap _INIT(0); // WLEDMM default 0
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* Adalight and TPM2 handler
|
* Adalight and TPM2 handler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SERIAL_MAXTIME_MILLIS 100 // to avoid blocking other activities, do not spend more than 100ms with continouus reading
|
#define SERIAL_MAXTIME_MILLIS 100 // to avoid blocking other activities, do not spend more than 100ms with continuous reading
|
||||||
// at 115200 baud, 100ms is enough to send/receive 1280 chars
|
// at 115200 baud, 100ms is enough to send/receive 1280 chars
|
||||||
|
|
||||||
enum class AdaState {
|
enum class AdaState {
|
||||||
|
|||||||
@@ -171,13 +171,13 @@ void sendDataWs(AsyncWebSocketClient * client)
|
|||||||
releaseJSONBufferLock();
|
releaseJSONBufferLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// WLEDMM function to recover full-brigh pixel (based on code from upstream alt-buffer, which is based on code from NeoPixelBrightnessBus)
|
// WLEDMM function to recover full-bright pixel (based on code from upstream alt-buffer, which is based on code from NeoPixelBrightnessBus)
|
||||||
static uint32_t restoreColorLossy(uint32_t c, uint_fast8_t _restaurationBri) {
|
static uint32_t restoreColorLossy(uint32_t c, uint_fast8_t _restaurationBri) {
|
||||||
if (_restaurationBri == 255) return c;
|
if (_restaurationBri == 255) return c;
|
||||||
uint8_t* chan = (uint8_t*) &c;
|
uint8_t* chan = (uint8_t*) &c;
|
||||||
for (uint_fast8_t i=0; i<4; i++) {
|
for (uint_fast8_t i=0; i<4; i++) {
|
||||||
uint_fast16_t val = chan[i];
|
uint_fast16_t val = chan[i];
|
||||||
chan[i] = ((val << 8) + _restaurationBri) / (_restaurationBri + 1); //adding _bri slighly improves recovery / stops degradation on re-scale
|
chan[i] = ((val << 8) + _restaurationBri) / (_restaurationBri + 1); //adding _bri slightly improves recovery / stops degradation on re-scale
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user