From 7360b882acff7e0c6a52d675324d688ff39136e1 Mon Sep 17 00:00:00 2001 From: cschwinne Date: Mon, 24 Feb 2020 12:54:23 +0100 Subject: [PATCH] DMX settings only when enabled --- wled00/wled00.ino | 7 ++++--- wled00/wled01_eeprom.ino | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 4da5c700..60643975 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -262,13 +262,14 @@ bool aOtaEnabled = true; //ArduinoOTA allows easy updates d uint16_t userVar0 = 0, userVar1 = 0; +#ifdef WLED_ENABLE_DMX //dmx CONFIG -uint16_t DMXChannels = 7; // number of channels per fixture -uint16_t DMXFixtureMap[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +byte DMXChannels = 7; // number of channels per fixture +byte DMXFixtureMap[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // assigns the different channels to different functions. See wled21_dmx.ino for more information. uint16_t DMXGap = 10; // gap between the fixtures. makes addressing easier because you don't have to memorize odd numbers when climbing up onto a rig. uint16_t DMXStart = 10; // start address of the first fixture - +#endif //internal global variable declarations diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index 73508a4f..0ff9497f 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -258,15 +258,17 @@ void saveSettingsToEEPROM() EEPROM.write(2523, (mqttPort >> 8) & 0xFF); // DMX (2530 - 2549) + #ifdef WLED_ENABLE_DMX EEPROM.write(2530, DMXChannels); EEPROM.write(2531, DMXGap & 0xFF); EEPROM.write(2532, (DMXGap >> 8) & 0xFF); EEPROM.write(2533, DMXStart & 0xFF); EEPROM.write(2534, (DMXStart >> 8) & 0xFF); - for (int i=0;i<15;i++) { + for (int i=0; i<15; i++) { EEPROM.write(2535+i, DMXFixtureMap[i]); } // last used: 2549. maybe leave a few bytes for future expansion and go on with 2600 kthxbye. + #endif commit(); } @@ -536,7 +538,7 @@ void loadSettingsFromEEPROM(bool first) readStringFromEEPROM(2220, blynkApiKey, 35); if (strlen(blynkApiKey) < 25) blynkApiKey[0] = 0; - + #ifdef WLED_ENABLE_DMX // DMX (2530 - 2549)2535 DMXChannels = EEPROM.read(2530); DMXGap = EEPROM.read(2531) + ((EEPROM.read(2532) << 8) & 0xFF00); @@ -545,7 +547,7 @@ void loadSettingsFromEEPROM(bool first) for (int i=0;i<15;i++) { DMXFixtureMap[i] = EEPROM.read(2535+i); } //last used: 2549. maybe leave a few bytes for future expansion and go on with 2600 kthxbye. - + #endif //user MOD memory //2944 - 3071 reserved