small updates
* colors.cpp: disable gamma calculation if CIE table mode is active (WLED_USE_CIE_BRIGHTNESS_TABLE) * fx.cpp: small improvement to FreqMap, and bugfix for effects that modify binNum / maxVol * pio: update for Line-In shield pins (final hardware version)
This commit is contained in:
@@ -940,9 +940,16 @@ build_flags =
|
||||
-D SR_SQUELCH=10 -D SR_GAIN=40 -D SR_FREQ_PROF=7 ; SPM1423 specific
|
||||
|
||||
[Shield_LineIn]
|
||||
build_unflags =
|
||||
-D BTNPIN=17 ;; remove - its in conflict with on-shield rotary
|
||||
-D ENCODER_SW_PIN=5 ;; remove - its in conflict with on-shield rotary
|
||||
-D BTNPIN=0 ;; remove - its in conflict with MCLK pin
|
||||
build_flags =
|
||||
-D SR_DMTYPE=4 -D MCLK_PIN=0 -D I2S_SDPIN=25 -D I2S_WSPIN=15 -D I2S_CKPIN=14 ; for audio Line-In shield
|
||||
-D SR_SQUELCH=2 -D SR_GAIN=40 -D SR_FREQ_PROF=1 ; CS5343 Line-In specific
|
||||
-D BTNPIN=-1
|
||||
-D SR_DMTYPE=4 -D MCLK_PIN=0 -D I2S_SDPIN=26 -D I2S_WSPIN=25 -D I2S_CKPIN=27 ; for audio Line-In shield, final version
|
||||
-D SR_LINE_DETECT=34 ; line-in plug insert detection sensor (future support)
|
||||
-D SR_SQUELCH=8 -D SR_GAIN=40 -D SR_FREQ_PROF=1 ; CS5343 Line-In specific
|
||||
-D ENCODER_DT_PIN=35 -D ENCODER_CLK_PIN=39 -D ENCODER_SW_PIN=17 ; on-shield rotary encoder
|
||||
|
||||
[Debug_Flags]
|
||||
build_flags =
|
||||
@@ -1547,6 +1554,7 @@ build_flags = ${wemos_shield_esp32_4MB_M_base.build_flags} ${Shield_SPM1423.buil
|
||||
|
||||
[env:wemos_shield_esp32_4MB_LineIn_M]
|
||||
extends = wemos_shield_esp32_4MB_M_base
|
||||
build_unflags = ${common.build_unflags} ${Shield_LineIn.build_unflags}
|
||||
build_flags = ${wemos_shield_esp32_4MB_M_base.build_flags} ${Shield_LineIn.build_flags}
|
||||
-D WLED_RELEASE_NAME=wemos_shield_esp32_4MB_LineIn_M
|
||||
|
||||
@@ -1602,6 +1610,7 @@ board_build.partitions = tools/WLED_ESP32_16MB.csv ;; WLED standard for
|
||||
|
||||
[env:wemos_shield_esp32_16MB_LineIn_M]
|
||||
extends = wemos_shield_esp32_4MB_M_base
|
||||
build_unflags = ${common.build_unflags} ${Shield_LineIn.build_unflags}
|
||||
build_flags = ${wemos_shield_esp32_4MB_M_base.build_flags} ${Shield_LineIn.build_flags}
|
||||
-D WLED_RELEASE_NAME=wemos_shield_esp32_16MB_LineIn_M
|
||||
board = esp32_16MB
|
||||
|
||||
@@ -6037,6 +6037,8 @@ uint16_t mode_ripplepeak(void) { // * Ripple peak. By Andrew Tuli
|
||||
SEGMENT.custom1 = *binNum;
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
if (SEGMENT.custom1 < 2) SEGMENT.custom1 = 2; // WLEDMM prevent stupid settings
|
||||
if (SEGMENT.custom2 < 48) SEGMENT.custom1 = 48; // WLEDMM prevent stupid settings
|
||||
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
@@ -6598,6 +6600,8 @@ uint16_t mode_puddlepeak(void) { // Puddlepeak. By Andrew Tuline.
|
||||
SEGMENT.custom1 = *binNum;
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
if (SEGMENT.custom1 < 2) SEGMENT.custom1 = 2; // WLEDMM prevent stupid settings
|
||||
if (SEGMENT.custom2 < 48) SEGMENT.custom1 = 48; // WLEDMM prevent stupid settings
|
||||
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
@@ -6794,9 +6798,17 @@ uint16_t mode_freqmap(void) { // Map FFT_MajorPeak to SEGLEN.
|
||||
uint16_t pixCol = (log10f(FFT_MajorPeak) - 1.78f) * 255.0f/(MAX_FREQ_LOG10 - 1.78f); // Scale log10 of frequency values to the 255 colour index.
|
||||
if (FFT_MajorPeak < 61.0f) pixCol = 0; // handle underflow
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
uint16_t bright = (int) (sqrtf(my_magnitude)*16.0f); // WLEDMM sqrt scaling, to make peaks more prominent
|
||||
#else
|
||||
uint16_t bright = (int)my_magnitude;
|
||||
#endif
|
||||
|
||||
SEGMENT.setPixelColor(locn, color_blend(SEGCOLOR(1), SEGMENT.color_from_palette(SEGMENT.intensity+pixCol, false, PALETTE_SOLID_WRAP, 0), bright));
|
||||
if (SEGMENT.speed > 228) { // WLEDMM looks nice in 2D
|
||||
SEGMENT.blur(5*(SEGMENT.speed - 224));
|
||||
SEGMENT.setPixelColor(locn, color_blend(SEGCOLOR(1), SEGMENT.color_from_palette(SEGMENT.intensity+pixCol, false, PALETTE_SOLID_WRAP, 0), bright));
|
||||
}
|
||||
|
||||
return FRAMETIME;
|
||||
} // mode_freqmap()
|
||||
@@ -7110,6 +7122,9 @@ uint16_t mode_waterfall(void) { // Waterfall. By: Andrew Tulin
|
||||
SEGMENT.custom2 = *maxVol * 2;
|
||||
}
|
||||
|
||||
if (SEGMENT.custom1 < 2) SEGMENT.custom1 = 2; // WLEDMM prevent stupid settings
|
||||
if (SEGMENT.custom2 < 48) SEGMENT.custom1 = 48; // WLEDMM prevent stupid settings
|
||||
|
||||
*binNum = SEGMENT.custom1; // Select a bin.
|
||||
*maxVol = SEGMENT.custom2 / 2; // Our volume comparator.
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ static byte gammaT[256] = {
|
||||
// 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.
|
||||
// see https://github.com/Makuna/NeoPixelBus/blob/master/src/internal/NeoGamma.h
|
||||
static byte gammaT[256] = {
|
||||
static const byte gammaT[256] = {
|
||||
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
|
||||
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6,
|
||||
@@ -354,9 +354,11 @@ uint8_t gamma8_cal(uint8_t b, float gamma)
|
||||
// re-calculates & fills gamma table
|
||||
void calcGammaTable(float gamma)
|
||||
{
|
||||
#if !defined(WLED_USE_CIE_BRIGHTNESS_TABLE) // WLEDMM not possible when using the CIE table
|
||||
for (uint16_t i = 0; i < 256; i++) {
|
||||
gammaT[i] = gamma8_cal(i, gamma);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// used for individual channel or brightness gamma correction
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2303300
|
||||
#define VERSION 2303310
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
||||
Reference in New Issue
Block a user