Skip to content

Commit d336b97

Browse files
committed
set output pin
1 parent 7d3a673 commit d336b97

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

wled00/dmx_output.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ void handleDMXOutput()
6666
dmx.update(); // update the DMX bus
6767
}
6868

69-
void initDMXOutput() {
70-
dmx.init(2); // set output pin and initialize DMX output
69+
void initDMXOutput(int outputPin) {
70+
if (outputPin < 1) return;
71+
dmx.init(outputPin); // set output pin and initialize DMX output
7172
}
7273

7374
#if !defined(ESP8266)

wled00/fcn_declare.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef struct WiFiConfig {
7575
} wifi_config;
7676

7777
//dmx_output.cpp
78-
void initDMXOutput();
78+
void initDMXOutput(int outputPin);
7979
void handleDMXOutput();
8080

8181
//dmx_input.cpp

wled00/wled.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ void WLED::setup()
517517
}
518518
#endif
519519
#ifdef WLED_ENABLE_DMX
520-
initDMXOutput();
520+
initDMXOutput(dmxOutputPin);
521521
#endif
522522
#ifdef WLED_ENABLE_DMX_INPUT
523523
dmxInput.init(dmxInputReceivePin, dmxInputTransmitPin, dmxInputEnablePin, dmxInputPort);

wled00/wled.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if
450450
WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black
451451

452452
#ifdef WLED_ENABLE_DMX
453+
WLED_GLOBAL int dmxOutputPin _INIT(2);
453454
WLED_GLOBAL uint16_t e131ProxyUniverse _INIT(0); // output this E1.31 (sACN) / ArtNet universe via MAX485 (0 = disabled)
454455
// dmx CONFIG
455456
WLED_GLOBAL byte DMXChannels _INIT(7); // number of channels per fixture

0 commit comments

Comments
 (0)