Add dmx input port to configuration

This commit is contained in:
Arne 2023-08-23 14:33:12 +02:00 committed by Will Tatam
parent 2cc5a29b86
commit 84eb6fd460
5 changed files with 7 additions and 3 deletions

View File

@ -156,6 +156,7 @@ Realtime LED offset: <input name="WO" type="number" min="-255" max="255" require
DMX RX: <input name="IDMR" type="number" min="-1" max="99"><br/>
DMX TX: <input name="IDMT" type="number" min="-1" max="99"><br/>
DMX Enable: <input name="IDME" type="number" min="-1" max="99"><br/>
DMX Port: <input name="IDMP" type="number" min="1" max="2"><br/>
</div>
<div id="dmxInputOff"> <!--WLEDMM-->
<br><em style="color:darkorange">This firmware build does not include DMX Input support. <br></em>

View File

@ -423,7 +423,9 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
#ifdef WLED_ENABLE_DMX_INPUT
dmxInputTransmitPin = request->arg(F("IDMT")).toInt();
dmxInputReceivePin = request->arg(F("IDMR")).toInt();
dmxInputEnablePin= request->arg(F("IDME")).toInt();
dmxInputEnablePin = request->arg(F("IDME")).toInt();
dmxInputPort = request->arg(F("IDMP")).toInt();
if(dmxInputPort <= 0 || dmxInputPort > 2) dmxInputPort = 2;
#endif
#ifndef WLED_DISABLE_ALEXA

View File

@ -541,8 +541,7 @@ void WLED::setup()
initDMX();
#endif
#ifdef WLED_ENABLE_DMX_INPUT
const uint8_t dmxInputPortNumber = 2; //TODO turn into config variable?!
dmxInput.init(dmxInputReceivePin, dmxInputTransmitPin, dmxInputEnablePin, dmxInputPortNumber);
dmxInput.init(dmxInputReceivePin, dmxInputTransmitPin, dmxInputEnablePin, dmxInputPort);
#endif
#ifdef WLED_ENABLE_ADALIGHT

View File

@ -467,6 +467,7 @@ WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to f
WLED_GLOBAL int dmxInputTransmitPin _INIT(0);
WLED_GLOBAL int dmxInputReceivePin _INIT(0);
WLED_GLOBAL int dmxInputEnablePin _INIT(0);
WLED_GLOBAL int dmxInputPort _INIT(2);
WLED_GLOBAL DMXInput dmxInput;
#endif

View File

@ -446,6 +446,7 @@ void getSettingsJS(byte subPage, Print& settingsScript)
sappend('v',SET_F("IDMT"),dmxInputTransmitPin);
sappend('v',SET_F("IDMR"),dmxInputReceivePin);
sappend('v',SET_F("IDME"),dmxInputEnablePin);
sappend('v',SET_F("IDMP"),dmxInputPort);
#endif
printSetFormValue(settingsScript,PSTR("DA"),DMXAddress);
printSetFormValue(settingsScript,PSTR("XX"),DMXSegmentSpacing);