mirror of
https://github.com/wled/WLED.git
synced 2025-07-10 20:36:32 +00:00
Rename WLED_ENABLE_DMX to WLED_ENABLE_DMX_OUTPUT
This commit is contained in:
parent
84eb6fd460
commit
7f9cc67518
@ -358,7 +358,7 @@ writeChunks(
|
|||||||
method: "plaintext",
|
method: "plaintext",
|
||||||
filter: "html-minify",
|
filter: "html-minify",
|
||||||
mangle: (str) => `
|
mangle: (str) => `
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
${str.replace(/function FM\(\)[ ]?\{/gms, "function FM() {%DMXVARS%\n")}
|
${str.replace(/function FM\(\)[ ]?\{/gms, "function FM() {%DMXVARS%\n")}
|
||||||
#else
|
#else
|
||||||
const char PAGE_dmxmap[] PROGMEM = R"=====()=====";
|
const char PAGE_dmxmap[] PROGMEM = R"=====()=====";
|
||||||
|
@ -651,7 +651,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
getStringFromJson(otaPass, pwd, 33); //normally not present due to security
|
getStringFromJson(otaPass, pwd, 33); //normally not present due to security
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
JsonObject dmx = doc["dmx"];
|
JsonObject dmx = doc["dmx"];
|
||||||
CJSON(DMXChannels, dmx[F("chan")]);
|
CJSON(DMXChannels, dmx[F("chan")]);
|
||||||
CJSON(DMXGap,dmx[F("gap")]);
|
CJSON(DMXGap,dmx[F("gap")]);
|
||||||
@ -1116,8 +1116,8 @@ void serializeConfig() {
|
|||||||
ota[F("pskl")] = strlen(otaPass);
|
ota[F("pskl")] = strlen(otaPass);
|
||||||
ota[F("aota")] = aOtaEnabled;
|
ota[F("aota")] = aOtaEnabled;
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
JsonObject dmx = root.createNestedObject("dmx");
|
JsonObject dmx = doc.createNestedObject("dmx");
|
||||||
dmx[F("chan")] = DMXChannels;
|
dmx[F("chan")] = DMXChannels;
|
||||||
dmx[F("gap")] = DMXGap;
|
dmx[F("gap")] = DMXGap;
|
||||||
dmx["start"] = DMXStart;
|
dmx["start"] = DMXStart;
|
||||||
|
@ -583,6 +583,13 @@
|
|||||||
#define DEFAULT_LED_COUNT 30
|
#define DEFAULT_LED_COUNT 30
|
||||||
|
|
||||||
#define INTERFACE_UPDATE_COOLDOWN 1000 // time in ms to wait between websockets, alexa, and MQTT updates
|
#define INTERFACE_UPDATE_COOLDOWN 1000 // time in ms to wait between websockets, alexa, and MQTT updates
|
||||||
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
|
#if (LEDPIN == 2)
|
||||||
|
#undef LEDPIN
|
||||||
|
#define LEDPIN 1
|
||||||
|
#warning "Pin conflict compiling with DMX and LEDs on pin 2. The default LED pin has been changed to pin 1."
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PIN_RETRY_COOLDOWN 3000 // time in ms after an incorrect attempt PIN and OTA pass will be rejected even if correct
|
#define PIN_RETRY_COOLDOWN 3000 // time in ms after an incorrect attempt PIN and OTA pass will be rejected even if correct
|
||||||
#define PIN_TIMEOUT 900000 // time in ms after which the PIN will be required again, 15 minutes
|
#define PIN_TIMEOUT 900000 // time in ms after which the PIN will be required again, 15 minutes
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* https://github.com/sparkfun/SparkFunDMX
|
* https://github.com/sparkfun/SparkFunDMX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
|
|
||||||
void handleDMX()
|
void handleDMX()
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ void handleE131Packet(e131_packet_t* p, IPAddress clientIP, byte protocol){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
// does not act on out-of-order packets yet
|
// does not act on out-of-order packets yet
|
||||||
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
|
if (e131ProxyUniverse > 0 && uni == e131ProxyUniverse) {
|
||||||
for (uint16_t i = 1; i <= dmxChannels; i++)
|
for (uint16_t i = 1; i <= dmxChannels; i++)
|
||||||
|
@ -598,7 +598,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX_OUTPUT // include only if DMX is enabled
|
||||||
if (subPage == SUBPAGE_DMX)
|
if (subPage == SUBPAGE_DMX)
|
||||||
{
|
{
|
||||||
int t = request->arg(F("PU")).toInt();
|
int t = request->arg(F("PU")).toInt();
|
||||||
|
@ -64,7 +64,7 @@ void WLED::loop()
|
|||||||
handleImprovWifiScan();
|
handleImprovWifiScan();
|
||||||
handleNotifications();
|
handleNotifications();
|
||||||
handleTransitions();
|
handleTransitions();
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
handleDMX();
|
handleDMX();
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_DMX_INPUT
|
#ifdef WLED_ENABLE_DMX_INPUT
|
||||||
@ -434,7 +434,7 @@ void WLED::setup()
|
|||||||
#if defined(WLED_DEBUG) && !defined(WLED_DEBUG_HOST)
|
#if defined(WLED_DEBUG) && !defined(WLED_DEBUG_HOST)
|
||||||
PinManager::allocatePin(hardwareTX, true, PinOwner::DebugOut); // TX (GPIO1 on ESP32) reserved for debug output
|
PinManager::allocatePin(hardwareTX, true, PinOwner::DebugOut); // TX (GPIO1 on ESP32) reserved for debug output
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_DMX //reserve GPIO2 as hardcoded DMX pin
|
#ifdef WLED_ENABLE_DMX_OUTPUT //reserve GPIO2 as hardcoded DMX pin
|
||||||
PinManager::allocatePin(2, true, PinOwner::DMX);
|
PinManager::allocatePin(2, true, PinOwner::DMX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ void WLED::setup()
|
|||||||
ArduinoOTA.setHostname(cmDNS);
|
ArduinoOTA.setHostname(cmDNS);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
initDMX();
|
initDMX();
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_DMX_INPUT
|
#ifdef WLED_ENABLE_DMX_INPUT
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
#else
|
#else
|
||||||
#undef WLED_ENABLE_ADALIGHT // disable has priority over enable
|
#undef WLED_ENABLE_ADALIGHT // disable has priority over enable
|
||||||
#endif
|
#endif
|
||||||
//#define WLED_ENABLE_DMX // uses 3.5kb
|
//#define WLED_ENABLE_DMX_OUTPUT // uses 3.5kb (use LEDPIN other than 2)
|
||||||
|
//#define WLED_ENABLE_DMX_INPUT // Listen for DMX over Serial
|
||||||
#ifndef WLED_DISABLE_LOXONE
|
#ifndef WLED_DISABLE_LOXONE
|
||||||
#define WLED_ENABLE_LOXONE // uses 1.2kb
|
#define WLED_ENABLE_LOXONE // uses 1.2kb
|
||||||
#endif
|
#endif
|
||||||
@ -136,7 +137,7 @@
|
|||||||
#include "src/dependencies/espalexa/EspalexaDevice.h"
|
#include "src/dependencies/espalexa/EspalexaDevice.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
|
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
#include "src/dependencies/dmx/ESPDMX.h"
|
#include "src/dependencies/dmx/ESPDMX.h"
|
||||||
#else //ESP32
|
#else //ESP32
|
||||||
@ -448,7 +449,7 @@ WLED_GLOBAL int arlsOffset _INIT(0); // realtime LE
|
|||||||
WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if gamma correction is handled by the source
|
WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if gamma correction is handled by the source
|
||||||
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
|
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
|
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
WLED_GLOBAL DMXESPSerial dmx;
|
WLED_GLOBAL DMXESPSerial dmx;
|
||||||
#else //ESP32
|
#else //ESP32
|
||||||
|
@ -313,7 +313,7 @@ void loadSettingsFromEEPROM()
|
|||||||
e131Port = EEPROM.read(2187) + ((EEPROM.read(2188) << 8) & 0xFF00);
|
e131Port = EEPROM.read(2187) + ((EEPROM.read(2188) << 8) & 0xFF00);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
if (lastEEPROMversion > 19)
|
if (lastEEPROMversion > 19)
|
||||||
{
|
{
|
||||||
e131ProxyUniverse = EEPROM.read(2185) + ((EEPROM.read(2186) << 8) & 0xFF00);
|
e131ProxyUniverse = EEPROM.read(2185) + ((EEPROM.read(2186) << 8) & 0xFF00);
|
||||||
@ -342,7 +342,7 @@ void loadSettingsFromEEPROM()
|
|||||||
//custom macro memory (16 slots/ each 64byte)
|
//custom macro memory (16 slots/ each 64byte)
|
||||||
//1024-2047 reserved
|
//1024-2047 reserved
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
// DMX (2530 - 2549)2535
|
// DMX (2530 - 2549)2535
|
||||||
DMXChannels = EEPROM.read(2530);
|
DMXChannels = EEPROM.read(2530);
|
||||||
DMXGap = EEPROM.read(2531) + ((EEPROM.read(2532) << 8) & 0xFF00);
|
DMXGap = EEPROM.read(2531) + ((EEPROM.read(2532) << 8) & 0xFF00);
|
||||||
|
@ -96,7 +96,7 @@ static void handleStaticContent(AsyncWebServerRequest *request, const String &pa
|
|||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
static String dmxProcessor(const String& var)
|
static String dmxProcessor(const String& var)
|
||||||
{
|
{
|
||||||
String mapJS;
|
String mapJS;
|
||||||
@ -426,7 +426,7 @@ void initServer()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
server.on(F("/dmxmap"), HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on(F("/dmxmap"), HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
request->send_P(200, FPSTR(CONTENT_TYPE_HTML), PAGE_dmxmap , dmxProcessor);
|
request->send_P(200, FPSTR(CONTENT_TYPE_HTML), PAGE_dmxmap , dmxProcessor);
|
||||||
});
|
});
|
||||||
@ -554,7 +554,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
|
|||||||
else if (url.indexOf( "sync") > 0) subPage = SUBPAGE_SYNC;
|
else if (url.indexOf( "sync") > 0) subPage = SUBPAGE_SYNC;
|
||||||
else if (url.indexOf( "time") > 0) subPage = SUBPAGE_TIME;
|
else if (url.indexOf( "time") > 0) subPage = SUBPAGE_TIME;
|
||||||
else if (url.indexOf(F("sec")) > 0) subPage = SUBPAGE_SEC;
|
else if (url.indexOf(F("sec")) > 0) subPage = SUBPAGE_SEC;
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
else if (url.indexOf( "dmx") > 0) subPage = SUBPAGE_DMX;
|
else if (url.indexOf( "dmx") > 0) subPage = SUBPAGE_DMX;
|
||||||
#endif
|
#endif
|
||||||
else if (url.indexOf( "um") > 0) subPage = SUBPAGE_UM;
|
else if (url.indexOf( "um") > 0) subPage = SUBPAGE_UM;
|
||||||
@ -591,7 +591,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
|
|||||||
case SUBPAGE_SYNC : strcpy_P(s, PSTR("Sync")); break;
|
case SUBPAGE_SYNC : strcpy_P(s, PSTR("Sync")); break;
|
||||||
case SUBPAGE_TIME : strcpy_P(s, PSTR("Time")); break;
|
case SUBPAGE_TIME : strcpy_P(s, PSTR("Time")); break;
|
||||||
case SUBPAGE_SEC : strcpy_P(s, PSTR("Security")); if (doReboot) strcpy_P(s2, PSTR("Rebooting, please wait ~10 seconds...")); break;
|
case SUBPAGE_SEC : strcpy_P(s, PSTR("Security")); if (doReboot) strcpy_P(s2, PSTR("Rebooting, please wait ~10 seconds...")); break;
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
case SUBPAGE_DMX : strcpy_P(s, PSTR("DMX")); break;
|
case SUBPAGE_DMX : strcpy_P(s, PSTR("DMX")); break;
|
||||||
#endif
|
#endif
|
||||||
case SUBPAGE_UM : strcpy_P(s, PSTR("Usermods")); break;
|
case SUBPAGE_UM : strcpy_P(s, PSTR("Usermods")); break;
|
||||||
@ -626,7 +626,7 @@ void serveSettings(AsyncWebServerRequest* request, bool post) {
|
|||||||
case SUBPAGE_SYNC : content = PAGE_settings_sync; len = PAGE_settings_sync_length; break;
|
case SUBPAGE_SYNC : content = PAGE_settings_sync; len = PAGE_settings_sync_length; break;
|
||||||
case SUBPAGE_TIME : content = PAGE_settings_time; len = PAGE_settings_time_length; break;
|
case SUBPAGE_TIME : content = PAGE_settings_time; len = PAGE_settings_time_length; break;
|
||||||
case SUBPAGE_SEC : content = PAGE_settings_sec; len = PAGE_settings_sec_length; break;
|
case SUBPAGE_SEC : content = PAGE_settings_sec; len = PAGE_settings_sec_length; break;
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
case SUBPAGE_DMX : content = PAGE_settings_dmx; len = PAGE_settings_dmx_length; break;
|
case SUBPAGE_DMX : content = PAGE_settings_dmx; len = PAGE_settings_dmx_length; break;
|
||||||
#endif
|
#endif
|
||||||
case SUBPAGE_UM : content = PAGE_settings_um; len = PAGE_settings_um_length; break;
|
case SUBPAGE_UM : content = PAGE_settings_um; len = PAGE_settings_um_length; break;
|
||||||
|
@ -100,7 +100,7 @@ void appendGPIOinfo(Print& settingsScript) {
|
|||||||
firstPin = false;
|
firstPin = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
if (!firstPin) settingsScript.print(',');
|
if (!firstPin) settingsScript.print(',');
|
||||||
settingsScript.print(2); // DMX hardcoded pin
|
settingsScript.print(2); // DMX hardcoded pin
|
||||||
firstPin = false;
|
firstPin = false;
|
||||||
@ -164,7 +164,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
#ifdef WLED_DISABLE_2D // include only if 2D is not compiled in
|
#ifdef WLED_DISABLE_2D // include only if 2D is not compiled in
|
||||||
settingsScript.print(F("gId('2dbtn').style.display='none';"));
|
settingsScript.print(F("gId('2dbtn').style.display='none';"));
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX_OUTPUT // include only if DMX is enabled
|
||||||
settingsScript.print(F("gId('dmxbtn').style.display='';"));
|
settingsScript.print(F("gId('dmxbtn').style.display='';"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -436,7 +436,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
printSetFormCheckbox(settingsScript,PSTR("ES"),e131SkipOutOfSequence);
|
printSetFormCheckbox(settingsScript,PSTR("ES"),e131SkipOutOfSequence);
|
||||||
printSetFormCheckbox(settingsScript,PSTR("EM"),e131Multicast);
|
printSetFormCheckbox(settingsScript,PSTR("EM"),e131Multicast);
|
||||||
printSetFormValue(settingsScript,PSTR("EU"),e131Universe);
|
printSetFormValue(settingsScript,PSTR("EU"),e131Universe);
|
||||||
#ifdef WLED_ENABLE_DMX
|
#ifdef WLED_ENABLE_DMX_OUTPUT
|
||||||
settingsScript.print(SET_F("hideNoDMX();")); // hide "not compiled in" message
|
settingsScript.print(SET_F("hideNoDMX();")); // hide "not compiled in" message
|
||||||
#endif
|
#endif
|
||||||
#ifndef WLED_ENABLE_DMX_INPUT
|
#ifndef WLED_ENABLE_DMX_INPUT
|
||||||
@ -596,7 +596,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
|
|||||||
settingsScript.printf_P(PSTR("sd=\"%s\";"), serverDescription);
|
settingsScript.printf_P(PSTR("sd=\"%s\";"), serverDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX_OUTPUT // include only if DMX is enabled
|
||||||
if (subPage == SUBPAGE_DMX)
|
if (subPage == SUBPAGE_DMX)
|
||||||
{
|
{
|
||||||
printSetFormValue(settingsScript,PSTR("PU"),e131ProxyUniverse);
|
printSetFormValue(settingsScript,PSTR("PU"),e131ProxyUniverse);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user