mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 18:26:32 +00:00
Swap DMX port to 1, persist user choice of port, validate port vs UART count
This commit is contained in:
parent
a56014bb66
commit
fc4e7a2dee
@ -527,6 +527,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
|
|||||||
CJSON(dmxInputTransmitPin, if_live_dmx[F("inputRxPin")]);
|
CJSON(dmxInputTransmitPin, if_live_dmx[F("inputRxPin")]);
|
||||||
CJSON(dmxInputReceivePin, if_live_dmx[F("inputTxPin")]);
|
CJSON(dmxInputReceivePin, if_live_dmx[F("inputTxPin")]);
|
||||||
CJSON(dmxInputEnablePin, if_live_dmx[F("inputEnablePin")]);
|
CJSON(dmxInputEnablePin, if_live_dmx[F("inputEnablePin")]);
|
||||||
|
CJSON(dmxInputPort, if_live_dmx[F("dmxInputPort")]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CJSON(arlsForceMaxBri, if_live[F("maxbri")]);
|
CJSON(arlsForceMaxBri, if_live[F("maxbri")]);
|
||||||
@ -1012,6 +1013,7 @@ void serializeConfig() {
|
|||||||
if_live_dmx[F("inputRxPin")] = dmxInputTransmitPin;
|
if_live_dmx[F("inputRxPin")] = dmxInputTransmitPin;
|
||||||
if_live_dmx[F("inputTxPin")] = dmxInputReceivePin;
|
if_live_dmx[F("inputTxPin")] = dmxInputReceivePin;
|
||||||
if_live_dmx[F("inputEnablePin")] = dmxInputEnablePin;
|
if_live_dmx[F("inputEnablePin")] = dmxInputEnablePin;
|
||||||
|
if_live_dmx[F("dmxInputPort")] = dmxInputPort;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if_live[F("timeout")] = realtimeTimeoutMs / 100;
|
if_live[F("timeout")] = realtimeTimeoutMs / 100;
|
||||||
|
@ -156,7 +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">RO<br/>
|
DMX RX: <input name="IDMR" type="number" min="-1" max="99">RO<br/>
|
||||||
DMX TX: <input name="IDMT" type="number" min="-1" max="99">DI<br/>
|
DMX TX: <input name="IDMT" type="number" min="-1" max="99">DI<br/>
|
||||||
DMX Enable: <input name="IDME" type="number" min="-1" max="99">RE+DE<br/>
|
DMX Enable: <input name="IDME" type="number" min="-1" max="99">RE+DE<br/>
|
||||||
<div style="display: none">DMX Port: <input name="IDMP" type="number" min="1" max="2"><br/></div>
|
DMX Port: <input name="IDMP" type="number" min="1" max="2"><br/>
|
||||||
</div>
|
</div>
|
||||||
<div id="dmxInputOff"> <!--WLEDMM-->
|
<div id="dmxInputOff"> <!--WLEDMM-->
|
||||||
<br><em style="color:darkorange">This firmware build does not include DMX Input support. <br></em>
|
<br><em style="color:darkorange">This firmware build does not include DMX Input support. <br></em>
|
||||||
|
@ -105,6 +105,7 @@ bool DMXInput::installDriver()
|
|||||||
{
|
{
|
||||||
|
|
||||||
const auto config = createConfig();
|
const auto config = createConfig();
|
||||||
|
USER_PRINTF("DMX port: %u\n", inputPortNum);
|
||||||
if (!dmx_driver_install(inputPortNum, &config, DMX_INTR_FLAGS_DEFAULT)) {
|
if (!dmx_driver_install(inputPortNum, &config, DMX_INTR_FLAGS_DEFAULT)) {
|
||||||
USER_PRINTF("Error: Failed to install dmx driver\n");
|
USER_PRINTF("Error: Failed to install dmx driver\n");
|
||||||
return false;
|
return false;
|
||||||
@ -133,7 +134,7 @@ void DMXInput::init(uint8_t rxPin, uint8_t txPin, uint8_t enPin, uint8_t inputPo
|
|||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (inputPortNum < 3 && inputPortNum > 0) {
|
if (inputPortNum <= (SOC_UART_NUM - 1) && inputPortNum > 0) {
|
||||||
this->inputPortNum = inputPortNum;
|
this->inputPortNum = inputPortNum;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user