Skip to content

Commit ce5ee65

Browse files
committed
Merge branch '0_15' into blending-styles
2 parents 1cee1c3 + 65a8dbf commit ce5ee65

File tree

27 files changed

+1265
-1062
lines changed

27 files changed

+1265
-1062
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## WLED changelog
22

3+
#### Build 2409140
4+
- Configure different kinds of busses at compile (#4107 by @PaoloTK)
5+
- BREAKING: removes LEDPIN and DEFAULT_LED_TYPE compile overrides
6+
- Fetch LED types from Bus classes (dynamic UI) (#4129 by @netmindz, @blazoncek, @dedehai)
7+
38
#### Build 2409100
49
- WLED 0.15.0-b5 release
510
- Audioreactive usermod included by default in all compatible builds (including ESP8266)

platformio.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ lib_deps =
140140
IRremoteESP8266 @ 2.8.2
141141
makuna/NeoPixelBus @ 2.8.0
142142
#https://github.com/makuna/NeoPixelBus.git#CoreShaderBeta
143-
https://github.com/Aircoookie/ESPAsyncWebServer.git @ 2.2.1
143+
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.2.1
144144
# for I2C interface
145145
;Wire
146146
# ESP-NOW library
@@ -234,7 +234,7 @@ lib_deps_compat =
234234
IRremoteESP8266 @ 2.8.2
235235
makuna/NeoPixelBus @ 2.7.9
236236
https://github.com/blazoncek/QuickESPNow.git#optional-debug
237-
https://github.com/Aircoookie/ESPAsyncWebServer.git @ 2.2.1
237+
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.2.1
238238

239239

240240
[esp32]
@@ -470,7 +470,7 @@ board_build.partitions = ${esp32.extended_partitions}
470470
build_unflags = ${common.build_unflags}
471471
build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=ESP32_WROVER
472472
-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ;; Older ESP32 (rev.<3) need a PSRAM fix (increases static RAM used) https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html
473-
-D LEDPIN=25
473+
-D DATA_PINS=25
474474
${esp32.AR_build_flags}
475475
lib_deps = ${esp32_idf_V4.lib_deps}
476476
${esp32.AR_lib_deps}
@@ -569,7 +569,7 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags} -D WLED_RELEASE_NAME=
569569
-DLOLIN_WIFI_FIX ; seems to work much better with this
570570
-D WLED_WATCHDOG_TIMEOUT=0
571571
-D CONFIG_ASYNC_TCP_USE_WDT=0
572-
-D LEDPIN=16
572+
-D DATA_PINS=16
573573
-D HW_PIN_SCL=35
574574
-D HW_PIN_SDA=33
575575
-D HW_PIN_CLOCKSPI=7

platformio_override.sample.ini

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ build_flags = ${common.build_flags} ${esp8266.build_flags}
5959
; -D WLED_ENABLE_DMX
6060
;
6161
; PIN defines - uncomment and change, if needed:
62-
; -D LEDPIN=2
62+
; -D DATA_PINS=2
6363
; or use this for multiple outputs
6464
; -D DATA_PINS=1,3
6565
; -D BTNPIN=0
@@ -233,7 +233,7 @@ platform = ${common.platform_wled_default}
233233
platform_packages = ${common.platform_packages}
234234
board_build.ldscript = ${common.ldscript_4m1m}
235235
build_unflags = ${common.build_unflags}
236-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D LEDPIN=1 -D WLED_DISABLE_INFRARED
236+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D DATA_PINS=1 -D WLED_DISABLE_INFRARED
237237
lib_deps = ${esp8266.lib_deps}
238238

239239
[env:esp32dev_qio80]
@@ -339,7 +339,7 @@ platform = ${common.platform_wled_default}
339339
platform_packages = ${common.platform_packages}
340340
board_build.ldscript = ${common.ldscript_4m1m}
341341
build_unflags = ${common.build_unflags}
342-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D LEDPIN=12 -D IRPIN=-1 -D RLYPIN=2
342+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D DATA_PINS=12 -D IRPIN=-1 -D RLYPIN=2
343343
lib_deps = ${esp8266.lib_deps}
344344

345345
[env:esp32c3dev_2MB]
@@ -367,7 +367,7 @@ platform_packages = ${esp32.platform_packages}
367367
upload_speed = 460800
368368
build_unflags = ${common.build_unflags}
369369
build_flags = ${common.build_flags} ${esp32.build_flags}
370-
-D LEDPIN=16
370+
-D DATA_PINS=16
371371
-D RLYPIN=19
372372
-D BTNPIN=17
373373
-D IRPIN=18
@@ -386,7 +386,7 @@ board_build.partitions = ${esp32.default_partitions}
386386
[env:m5atom]
387387
board = esp32dev
388388
build_unflags = ${common.build_unflags}
389-
build_flags = ${common.build_flags} ${esp32.build_flags} -D LEDPIN=27 -D BTNPIN=39
389+
build_flags = ${common.build_flags} ${esp32.build_flags} -D DATA_PINS=27 -D BTNPIN=39
390390
lib_deps = ${esp32.lib_deps}
391391
platform = ${esp32.platform}
392392
platform_packages = ${esp32.platform_packages}
@@ -396,14 +396,14 @@ board_build.partitions = ${esp32.default_partitions}
396396
board = esp_wroom_02
397397
platform = ${common.platform_wled_default}
398398
board_build.ldscript = ${common.ldscript_2m512k}
399-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D LEDPIN=3 -D BTNPIN=1
399+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D DATA_PINS=3 -D BTNPIN=1
400400
lib_deps = ${esp8266.lib_deps}
401401

402402
[env:sp511e]
403403
board = esp_wroom_02
404404
platform = ${common.platform_wled_default}
405405
board_build.ldscript = ${common.ldscript_2m512k}
406-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D LEDPIN=3 -D BTNPIN=2 -D IRPIN=5 -D WLED_MAX_BUTTONS=3
406+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D DATA_PINS=3 -D BTNPIN=2 -D IRPIN=5 -D WLED_MAX_BUTTONS=3
407407
lib_deps = ${esp8266.lib_deps}
408408

409409
[env:Athom_RGBCW] ;7w and 5w(GU10) bulbs
@@ -432,7 +432,7 @@ platform = ${common.platform_wled_default}
432432
platform_packages = ${common.platform_packages}
433433
board_build.ldscript = ${common.ldscript_2m512k}
434434
build_unflags = ${common.build_unflags}
435-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=0 -D RLYPIN=-1 -D LEDPIN=1 -D WLED_DISABLE_INFRARED
435+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=0 -D RLYPIN=-1 -D DATA_PINS=1 -D WLED_DISABLE_INFRARED
436436
lib_deps = ${esp8266.lib_deps}
437437

438438
[env:Athom_4Pin_Controller] ; With clock and data interface
@@ -441,7 +441,7 @@ platform = ${common.platform_wled_default}
441441
platform_packages = ${common.platform_packages}
442442
board_build.ldscript = ${common.ldscript_2m512k}
443443
build_unflags = ${common.build_unflags}
444-
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=0 -D RLYPIN=12 -D LEDPIN=1 -D WLED_DISABLE_INFRARED
444+
build_flags = ${common.build_flags} ${esp8266.build_flags} -D BTNPIN=0 -D RLYPIN=12 -D DATA_PINS=1 -D WLED_DISABLE_INFRARED
445445
lib_deps = ${esp8266.lib_deps}
446446

447447
[env:Athom_5Pin_Controller] ;Analog light strip controller
@@ -496,7 +496,7 @@ upload_speed = 921600
496496
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_DISABLE_BROWNOUT_DET -D WLED_DISABLE_INFRARED
497497
-D USERMOD_RTC
498498
-D USERMOD_ELEKSTUBE_IPS
499-
-D LEDPIN=12
499+
-D DATA_PINS=12
500500
-D RLYPIN=27
501501
-D BTNPIN=34
502502
-D DEFAULT_LED_COUNT=6

usermods/Temperature/usermod_temperature.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#define USERMOD_DALLASTEMPERATURE_MEASUREMENT_INTERVAL 60000
1818
#endif
1919

20+
static uint16_t mode_temperature();
21+
2022
class UsermodTemperature : public Usermod {
2123

2224
private:
@@ -60,6 +62,7 @@ class UsermodTemperature : public Usermod {
6062
static const char _sensor[];
6163
static const char _temperature[];
6264
static const char _Temperature[];
65+
static const char _data_fx[];
6366

6467
//Dallas sensor quick (& dirty) reading. Credit to - Author: Peter Scargill, August 17th, 2013
6568
float readDallas();
@@ -70,8 +73,13 @@ class UsermodTemperature : public Usermod {
7073
void publishHomeAssistantAutodiscovery();
7174
#endif
7275

76+
static UsermodTemperature* _instance; // to overcome nonstatic getTemperatureC() method and avoid usermods.lookup(USERMOD_ID_TEMPERATURE);
77+
7378
public:
7479

80+
UsermodTemperature() { _instance = this; }
81+
static UsermodTemperature *getInstance() { return UsermodTemperature::_instance; }
82+
7583
/*
7684
* API calls te enable data exchange between WLED modules
7785
*/
@@ -234,6 +242,7 @@ void UsermodTemperature::setup() {
234242
}
235243
temperaturePin = -1; // allocation failed
236244
}
245+
if (sensorFound && !initDone) strip.addEffect(255, &mode_temperature, _data_fx);
237246
}
238247
lastMeasurement = millis() - readingInterval + 10000;
239248
initDone = true;
@@ -440,6 +449,8 @@ const char *UsermodTemperature::getTemperatureUnit() {
440449
return degC ? "°C" : "°F";
441450
}
442451

452+
UsermodTemperature* UsermodTemperature::_instance = nullptr;
453+
443454
// strings to reduce flash memory usage (used more than twice)
444455
const char UsermodTemperature::_name[] PROGMEM = "Temperature";
445456
const char UsermodTemperature::_enabled[] PROGMEM = "enabled";
@@ -449,4 +460,14 @@ const char UsermodTemperature::_parasitePin[] PROGMEM = "parasite-pwr-pin";
449460
const char UsermodTemperature::_domoticzIDX[] PROGMEM = "domoticz-idx";
450461
const char UsermodTemperature::_sensor[] PROGMEM = "sensor";
451462
const char UsermodTemperature::_temperature[] PROGMEM = "temperature";
452-
const char UsermodTemperature::_Temperature[] PROGMEM = "/temperature";
463+
const char UsermodTemperature::_Temperature[] PROGMEM = "/temperature";
464+
const char UsermodTemperature::_data_fx[] PROGMEM = "Temperature@Min,Max;;!;01;pal=54";
465+
466+
static uint16_t mode_temperature() {
467+
float low = mapf((float)SEGMENT.speed, 0.f, 255.f, -150.f, 149.9f); // default: 0°C, range: -15°C to 15°C
468+
float high = mapf((float)SEGMENT.intensity, 0.f, 255.f, 150.f, 450.f); // default: 30°C, range 15°C to 45°C
469+
float temp = constrain(UsermodTemperature::getInstance()->getTemperatureC()*10.f, low, high); // get a little better resolution
470+
unsigned i = map(temp, (unsigned)low, (unsigned)high, 0, 255);
471+
SEGMENT.fill(SEGMENT.color_from_palette(i, false, false, 255));
472+
return FRAMETIME;
473+
}

usermods/audioreactive/audio_reactive.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ static bool useBandPassFilter = false; // if true, enables a
149149
////////////////////
150150

151151
// some prototypes, to ensure consistent interfaces
152-
static float mapf(float x, float in_min, float in_max, float out_min, float out_max); // map function for float
153152
static float fftAddAvg(int from, int to); // average of several FFT result bins
154153
void FFTcode(void * parameter); // audio processing task: read samples, run FFT, fill GEQ channels from FFT results
155154
static void runMicFilter(uint16_t numSamples, float *sampleBuffer); // pre-filtering of raw samples (band-pass)
@@ -211,11 +210,6 @@ static ArduinoFFT<float> FFT = ArduinoFFT<float>( vReal, vImag, samplesFFT, SAMP
211210

212211
// Helper functions
213212

214-
// float version of map()
215-
static float mapf(float x, float in_min, float in_max, float out_min, float out_max){
216-
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
217-
}
218-
219213
// compute average of several FFT result bins
220214
static float fftAddAvg(int from, int to) {
221215
float result = 0.0f;

0 commit comments

Comments
 (0)