mirror of
https://github.com/wled/WLED.git
synced 2025-07-18 16:26:32 +00:00
Monitor dmx personality and dmx start address for change and update rdm
This commit is contained in:
parent
9d8fdd0b20
commit
be3e331afb
@ -90,6 +90,9 @@ void DMXInput::update()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkAndUpdateConfig();
|
||||||
|
|
||||||
byte dmxdata[DMX_PACKET_SIZE];
|
byte dmxdata[DMX_PACKET_SIZE];
|
||||||
dmx_packet_t packet;
|
dmx_packet_t packet;
|
||||||
unsigned long now = millis();
|
unsigned long now = millis();
|
||||||
@ -169,4 +172,29 @@ bool DMXInput::isIdentifyOn() const
|
|||||||
// but just in case we check for it anyway
|
// but just in case we check for it anyway
|
||||||
return bool(identify) && gotIdentify;
|
return bool(identify) && gotIdentify;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DMXInput::checkAndUpdateConfig()
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The global configuration variables are modified by the web interface.
|
||||||
|
* If they differ from the driver configuration, we have to update the driver
|
||||||
|
* configuration.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const uint8_t currentPersonality = dmx_get_current_personality(inputPortNum);
|
||||||
|
if (currentPersonality != DMXMode)
|
||||||
|
{
|
||||||
|
DEBUG_PRINTF("DMX personality has changed from %d to %d\n", currentPersonality, DMXMode);
|
||||||
|
dmx_set_current_personality(inputPortNum, DMXMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint16_t currentAddr = dmx_get_start_address(inputPortNum);
|
||||||
|
if (currentAddr != DMXAddress)
|
||||||
|
{
|
||||||
|
DEBUG_PRINTF("DMX address has changed from %d to %d\n", currentAddr, DMXAddress);
|
||||||
|
dmx_set_start_address(inputPortNum, DMXAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -20,6 +20,11 @@ private:
|
|||||||
/// @return true if rdm identify is active
|
/// @return true if rdm identify is active
|
||||||
bool isIdentifyOn() const;
|
bool isIdentifyOn() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the global dmx config has changed and updates the changes in rdm
|
||||||
|
*/
|
||||||
|
void checkAndUpdateConfig();
|
||||||
|
|
||||||
/// overrides everything and turns on all leds
|
/// overrides everything and turns on all leds
|
||||||
void turnOnAllLeds();
|
void turnOnAllLeds();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user