Merge branch 'MoonModules:mdev' into mdev
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
|
||||
// auto-off feature
|
||||
#ifndef USERMOD_BATTERY_AUTO_OFF_ENABLED
|
||||
#define USERMOD_BATTERY_AUTO_OFF_ENABLED true
|
||||
#define USERMOD_BATTERY_AUTO_OFF_ENABLED false
|
||||
#endif
|
||||
|
||||
#ifndef USERMOD_BATTERY_AUTO_OFF_THRESHOLD
|
||||
@@ -78,4 +78,4 @@
|
||||
|
||||
#ifndef USERMOD_BATTERY_LOW_POWER_INDICATOR_DURATION
|
||||
#define USERMOD_BATTERY_LOW_POWER_INDICATOR_DURATION 5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1922,6 +1922,71 @@ uint16_t mode_pride_2015(void) {
|
||||
static const char _data_FX_MODE_PRIDE_2015[] PROGMEM = "Pride 2015@!;;";
|
||||
|
||||
|
||||
//////////////////////
|
||||
// PARTYJERK //
|
||||
//////////////////////
|
||||
// by @tonyxforce
|
||||
// NB: This effects expects a palette that starts with black and then ramps up brightness.
|
||||
// Currently works best with the "color gradient" and the "colors 1&2" palettes
|
||||
uint16_t mode_partyjerk() {
|
||||
if (SEGENV.call == 0) {
|
||||
SEGMENT.fill(BLACK); // clear LEDs
|
||||
SEGENV.aux0 = 0;
|
||||
SEGENV.aux1 = 0;
|
||||
SEGENV.step = 0;
|
||||
}
|
||||
/*
|
||||
* use of persistent variables:
|
||||
* aux0: hueDelay
|
||||
* aux1: hue
|
||||
* step: pos
|
||||
*/
|
||||
|
||||
um_data_t *um_data;
|
||||
if (!usermods.getUMData(&um_data, USERMOD_ID_AUDIOREACTIVE)) {
|
||||
// add support for no audio
|
||||
um_data = simulateSound(SEGMENT.soundSim);
|
||||
}
|
||||
float volumeSmth = *(float*) um_data->u_data[0];
|
||||
|
||||
SEGENV.aux0++;
|
||||
if (SEGENV.aux1 > 254) {
|
||||
SEGENV.aux1 = 0;
|
||||
}
|
||||
if (SEGENV.aux0 > map(SEGMENT.custom1, 0, 255, 0, 14)) {
|
||||
SEGENV.aux0 = 0;
|
||||
SEGENV.aux1++;
|
||||
}
|
||||
|
||||
uint_fast32_t speed = 0;
|
||||
uint16_t counter = 0;
|
||||
|
||||
if (volumeSmth * 2 > (255 - SEGMENT.intensity)) {
|
||||
speed = SEGMENT.speed * map(SEGMENT.custom2, 0, 255, 0, 100);
|
||||
} else {
|
||||
speed = SEGMENT.speed;
|
||||
};
|
||||
|
||||
SEGENV.step += speed;
|
||||
counter = SEGENV.step >> 8;
|
||||
|
||||
for (unsigned i = 0; i < SEGLEN; i++) {
|
||||
uint8_t colorIndex = ((i * 255) / SEGLEN) - counter;
|
||||
uint32_t paletteColor = SEGMENT.color_from_palette(colorIndex, false, PALETTE_MOVING_WRAP, 255);
|
||||
uint8_t r = R(paletteColor);
|
||||
uint8_t g = G(paletteColor);
|
||||
uint8_t b = B(paletteColor);
|
||||
uint8_t activeColor = max(r, max(g, b));
|
||||
|
||||
CRGB rgb(CHSV(SEGENV.aux1, 255, activeColor));
|
||||
SEGMENT.setPixelColor((uint16_t)i, rgb.r, rgb.g, rgb.b);
|
||||
};
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_partyjerk()
|
||||
static const char _data_FX_MODE_PARTYJERK[] PROGMEM = "Party jerk@Effect speed,Sensitivity,Color change speed,Effect speed active multiplier;!,!;!;1v;c1=8,c2=48,m12=0,si=0";
|
||||
|
||||
|
||||
//eight colored dots, weaving in and out of sync with each other
|
||||
uint16_t mode_juggle(void) {
|
||||
if (SEGLEN == 1) return mode_static();
|
||||
@@ -8235,6 +8300,7 @@ void WS2812FX::setupEffectData() {
|
||||
// --- 1D audio effects ---
|
||||
addEffect(FX_MODE_PIXELS, &mode_pixels, _data_FX_MODE_PIXELS);
|
||||
addEffect(FX_MODE_PIXELWAVE, &mode_pixelwave, _data_FX_MODE_PIXELWAVE);
|
||||
addEffect(FX_MODE_PARTYJERK, &mode_partyjerk, _data_FX_MODE_PARTYJERK);
|
||||
addEffect(FX_MODE_JUGGLES, &mode_juggles, _data_FX_MODE_JUGGLES);
|
||||
addEffect(FX_MODE_MATRIPIX, &mode_matripix, _data_FX_MODE_MATRIPIX);
|
||||
addEffect(FX_MODE_GRAVIMETER, &mode_gravimeter, _data_FX_MODE_GRAVIMETER);
|
||||
|
||||
@@ -334,8 +334,9 @@ void strip_wait_until_idle(String whoCalledMe); // WLEDMM implemented in FX_fcn.
|
||||
#define FX_MODE_ROCKTAVES 185
|
||||
#define FX_MODE_2DAKEMI 186
|
||||
#define FX_MODE_ARTIFX 187 //WLEDMM ARTIFX
|
||||
#define FX_MODE_PARTYJERK 188
|
||||
|
||||
#define MODE_COUNT 188
|
||||
#define MODE_COUNT 189
|
||||
|
||||
typedef enum mapping1D2D {
|
||||
M12_Pixels = 0,
|
||||
@@ -397,7 +398,7 @@ typedef struct Segment {
|
||||
uint16_t aux0; // custom var
|
||||
uint16_t aux1; // custom var
|
||||
byte* data = nullptr; // effect data pointer // WLEDMM initialize to nullptr
|
||||
CRGB* ledsrgb = nullptr; // local leds[] array (may be a pointer to global) //WLEDMM rename to ledsrgb to search on them (temp?), and initialilize to nullptr
|
||||
CRGB* ledsrgb = nullptr; // local leds[] array (may be a pointer to global) //WLEDMM rename to ledsrgb to search on them (temp?), and initialize to nullptr
|
||||
size_t ledsrgbSize; //WLEDMM
|
||||
static CRGB *_globalLeds; // global leds[] array
|
||||
static uint16_t maxWidth, maxHeight; // these define matrix width & height (max. segment dimensions)
|
||||
|
||||
@@ -423,12 +423,12 @@
|
||||
#if defined(BOARD_HAS_PSRAM) && (defined(WLED_USE_PSRAM) || defined(WLED_USE_PSRAM_JSON))
|
||||
#if defined(ARDUINO_ARCH_ESP32S2) || defined(ARDUINO_ARCH_ESP32C3)
|
||||
#if defined(ARDUINO_ARCH_ESP32C3)
|
||||
#define JSON_BUFFER_SIZE 46000 // WLEDMM - max 46KB on -C3 with PSRAM (chip has 400kb RAM)
|
||||
#define JSON_BUFFER_SIZE 44000 // WLEDMM - max 44KB on -C3 with PSRAM (chip has 400kb RAM)
|
||||
#else
|
||||
#define JSON_BUFFER_SIZE 36000 // WLEDMM - max 36KB on -S2 with PSRAM (chip has 320kb RAM)
|
||||
#define JSON_BUFFER_SIZE 32000 // WLEDMM - max 32KB on -S2 with PSRAM (chip has 320kb RAM)
|
||||
#endif
|
||||
#else
|
||||
#define JSON_BUFFER_SIZE 56000 // WLEDMM (was 60000) slightly reduced to avoid build error "region dram0_0_seg overflowed"
|
||||
#define JSON_BUFFER_SIZE 54000 // WLEDMM (was 60000) slightly reduced to avoid build error "region dram0_0_seg overflowed"
|
||||
#endif
|
||||
#else
|
||||
#define JSON_BUFFER_SIZE 24576
|
||||
|
||||
@@ -225,7 +225,7 @@ void registerUsermods()
|
||||
*/
|
||||
//usermods.add(new MyExampleUsermod());
|
||||
#ifdef USERMOD_BATTERY
|
||||
usermods.add(new UsermodBattery("Battery", true));
|
||||
usermods.add(new UsermodBattery("Battery", false)); // WLEDMM
|
||||
#endif
|
||||
|
||||
#ifdef USERMOD_DALLASTEMPERATURE
|
||||
@@ -293,7 +293,7 @@ void registerUsermods()
|
||||
#endif
|
||||
|
||||
#ifdef USERMOD_RTC
|
||||
usermods.add(new RTCUsermod("RTC", true));
|
||||
usermods.add(new RTCUsermod("RTC", false)); //WLEDMM
|
||||
#endif
|
||||
|
||||
#ifdef USERMOD_ELEKSTUBE_IPS
|
||||
@@ -385,7 +385,7 @@ void registerUsermods()
|
||||
#endif
|
||||
|
||||
#ifdef USERMOD_MCUTEMP
|
||||
usermods.add(new mcuTemp("MCUTemp", true));
|
||||
usermods.add(new mcuTemp("MCUTemp", false));
|
||||
#endif
|
||||
|
||||
//#ifdef USERMOD_INTERNAL_TEMPERATURE
|
||||
|
||||
Reference in New Issue
Block a user