Skip to content

Commit

Permalink
remove double-lockout for Alexa and IR Remotes
Browse files Browse the repository at this point in the history
This removes the "double lockout" in wled.h - users may now decide to not disable IR or Alexa in their custom build environments.

The lockout is not strictly necessary any more. We have a faster FFT library now, so some other background activity should be ok.
  • Loading branch information
softhack007 committed Sep 2, 2023
1 parent be2f4e0 commit b44d810
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 13 deletions.
49 changes: 39 additions & 10 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,13 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 460800 ; 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32dev -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32dev
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA -D WLED_DISABLE_INFRARED
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio
Expand All @@ -463,9 +466,14 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32_eth -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
build_flags = ${common.build_flags_esp32} -D WLED_RELEASE_NAME=soundReactive_esp32_eth -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA -D WLED_DISABLE_INFRARED
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
; lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
; monitor_filters = esp32_exception_decoder ; used to show crash details

board_build.partitions = ${esp32.default_partitions}
; board_build.f_flash = 80000000L
; board_build.flash_mode = dio
Expand All @@ -476,10 +484,13 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
build_flags = ${common.build_flags_esp32}
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA -D WLED_DISABLE_INFRARED
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
; lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio
Expand All @@ -490,10 +501,13 @@ platform = ${esp32.platform}
platform_packages = ${esp32.platform_packages}
upload_speed = 921600
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} -D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
build_flags = ${common.build_flags_esp32}
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA -D WLED_DISABLE_INFRARED
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
; lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.f_cpu = 240000000L
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
Expand All @@ -512,6 +526,8 @@ build_flags = ${common.build_flags_esp32}
-D WLED_RELEASE_NAME=soundReactive_m5atom
-D WLED_DISABLE_MQTT
-D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA
-D WLED_DISABLE_INFRARED
-D LEDPIN=27
-D BTNPIN=39
-D I2S_SDPIN=26 -D I2S_WSPIN=32 -D I2S_CKPIN=-1 -D MCLK_PIN=-1 ;; PDM microphone pins
Expand All @@ -520,7 +536,8 @@ build_flags = ${common.build_flags_esp32}
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
m5stack/M5Atom @ ~0.1.0 ;; specific hardware driver library
monitor_filters = esp32_exception_decoder
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dio
Expand All @@ -536,17 +553,20 @@ build_flags = ${common.build_flags_esp32}
-D WLED_RELEASE_NAME=soundReactive_m5StickC_Plus
-D WLED_DISABLE_MQTT
-D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA
-D LEDPIN=32
-D BTNPIN=37
; -D IRPIN=9 ;; gpio 9 will not work in WLED - its a "reserved pin" for flash memory
-D WLED_DISABLE_INFRARED
; -D STATUSLED=10 ;; gpio 10 will not work either, for the same reason
-D I2S_SDPIN=34 -D I2S_WSPIN=0 -D I2S_CKPIN=-1 -D MCLK_PIN=-1 ;; PDM microphone pins
-D DMENABLED=5 -D SR_SQUELCH=5 -D SR_GAIN=75 ;; SPM1423 specific sound settings
-D I2S_USE_RIGHT_CHANNEL ;; might be needed, if your microphone uses the right channel instead of left
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
https://github.com/m5stack/M5StickC-Plus.git @ ~0.0.8 ;; specific hardware driver library
monitor_filters = esp32_exception_decoder
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
;; board_build.flash_mode = dio
Expand All @@ -562,14 +582,16 @@ build_flags = ${common.build_flags_esp32}
-D WLED_RELEASE_NAME=soundReactive_m5stamp-pico
-D WLED_DISABLE_MQTT
-D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA -D WLED_DISABLE_INFRARED
-D LEDPIN=27
-D BTNPIN=39
-D I2S_SDPIN=26 -D I2S_WSPIN=32 -D I2S_CKPIN=-1 -D MCLK_PIN=-1 ;; PDM microphone pins
-D DMENABLED=5 -D SR_SQUELCH=5 -D SR_GAIN=75 ;; SPM1423 specific sound settings
;-D I2S_USE_RIGHT_CHANNEL ;; might be needed, if your microphone uses the right channel instead of left
-D USERMOD_ARTIFX ; WLEDMM usermod
lib_deps = ${esp32.lib_deps}
monitor_filters = esp32_exception_decoder
lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
monitor_filters = esp32_exception_decoder ; used to show crash details
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = dout
Expand All @@ -591,6 +613,8 @@ build_flags = ${common.build_flags_esp32}
-D UWLED_USE_MY_CONFIG
-D USERMOD_DALLASTEMPERATURE
-D USERMOD_FOUR_LINE_DISPLAY
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
-D WLED_DISABLE_ALEXA ;; -D WLED_DISABLE_INFRARED
-D USERMOD_ARTIFX ; WLEDMM usermod
-D TEMPERATURE_PIN=23
lib_deps = ${esp32.lib_deps}
Expand All @@ -609,6 +633,7 @@ build_flags_S =
-Wall -Wformat -Woverflow -Wuninitialized -Winit-self -Warray-bounds ; enables more warnings
-Wno-attributes -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations ;disables some stupid warnings
-D WLED_DISABLE_MQTT -D WLED_DISABLE_LOXONE
;; -D WLED_DISABLE_INFRARED ;; -D WLED_DISABLE_ALEXA
;-D WLED_DISABLE_BLYNK ; BLYNK is only provided for backwards compatibility (no new users accepted). Additionally, it calls analogRead() which could confuse analog mics
;-D WLED_DISABLE_BROWNOUT_DET ; enable if you get "brownout detected" errors at startup
-D USERMOD_ARTIFX ; WLEDMM usermod
Expand Down Expand Up @@ -645,6 +670,8 @@ upload_speed = 460800 ; or 921600
platform_packages = ${esp32.platform_packages}
build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags_esp32} ${common_sr.build_flags_S}
-D WLED_DISABLE_ALEXA
-D WLED_DISABLE_INFRARED
lib_deps = ${esp32.lib_deps} ${common_sr.lib_deps_S}
board_build.partitions = ${esp32.default_partitions}
board_build.f_flash = 80000000L ; use full 80MHz speed for flash (default = 40Mhz)
Expand All @@ -653,6 +680,8 @@ board_build.flash_mode = dio ; (dio = dual i/o; more compatible than qio = quad
;esp32_4MB_M_base: basis for max entries, uses esp32_4MB_S_base, build_flags_M and lib_deps_M
[esp32_4MB_M_base]
extends = esp32_4MB_S_base
build_unflags = ${common.build_unflags}
-D WLED_DISABLE_INFRARED ;; support IR Remotes in"_M" builds
build_flags = ${esp32_4MB_S_base.build_flags} ${common_sr.build_flags_M}
lib_deps = ${esp32_4MB_S_base.lib_deps} ${common_sr.lib_deps_M}
board_build.partitions = ${esp32_4MB_S_base.board_build.partitions}
Expand Down
2 changes: 2 additions & 0 deletions wled00/alexa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "src/dependencies/espalexa/EspalexaDevice.h"

#ifndef WLED_DISABLE_ALEXA
#warning Alexa enabled. Alexa is not officially supported in WLED-SR

void onAlexaChange(EspalexaDevice* dev);

void alexaInit()
Expand Down
2 changes: 2 additions & 0 deletions wled00/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/

#ifdef WLED_ENABLE_MQTT
#warning MQTT enabled. MQTT is not officially supported in WLED-SR

#define MQTT_KEEP_ALIVE_TIME 60 // contact the MQTT broker every 60 seconds

void parseMQTTBriPayload(char* payload)
Expand Down
6 changes: 3 additions & 3 deletions wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

// version code in format yymmddb (b = daily build)
#define VERSION 2308301 // WLEDSR specific version
#define VERSION 2309021 // WLEDSR specific version
#define SR_VERSION_NAME "0.13.4-beta" // WLEDSR version name --> some files need manual updating: package.json, package-lock.json, improv.cpp

#define AC_VERSION 2208222 // AC WLED base version; last updated by PR #239 -> Merge AC-0.13.3 into dev
Expand All @@ -32,10 +32,10 @@
#endif

// You need to choose some of these features to disable:
#define WLED_DISABLE_ALEXA // saves 11kb
//#define WLED_DISABLE_ALEXA // saves 11kb
#define WLED_DISABLE_BLYNK // saves 6kb
#define WLED_DISABLE_HUESYNC // saves 4kb
#define WLED_DISABLE_INFRARED // there is no pin left for this on ESP8266-01, saves 12kb
// #define WLED_DISABLE_INFRARED // there is no pin left for this on ESP8266-01, saves 12kb
#ifndef WLED_DISABLE_MQTT
#define WLED_ENABLE_MQTT // saves 12kb
#endif
Expand Down

0 comments on commit b44d810

Please sign in to comment.