mirror of
https://github.com/wled/WLED.git
synced 2025-07-21 01:36:32 +00:00
extract test for rdm identify into own method
This commit is contained in:
parent
033c7abe62
commit
9d8fdd0b20
@ -103,11 +103,9 @@ void DMXInput::update()
|
|||||||
connected = true;
|
connected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t identify = 0;
|
if (isIdentifyOn())
|
||||||
const bool gotIdentify = rdm_get_identify_device(inputPortNum, &identify);
|
|
||||||
// gotIdentify should never be false because it is a default parameter in rdm but just in case we check for it anyway
|
|
||||||
if (identify && gotIdentify)
|
|
||||||
{
|
{
|
||||||
|
DEBUG_PRINTLN("RDM Identify active");
|
||||||
turnOnAllLeds();
|
turnOnAllLeds();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -162,4 +160,13 @@ void DMXInput::enable()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DMXInput::isIdentifyOn() const
|
||||||
|
{
|
||||||
|
|
||||||
|
uint8_t identify = 0;
|
||||||
|
const bool gotIdentify = rdm_get_identify_device(inputPortNum, &identify);
|
||||||
|
// gotIdentify should never be false because it is a default parameter in rdm
|
||||||
|
// but just in case we check for it anyway
|
||||||
|
return bool(identify) && gotIdentify;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
@ -17,6 +17,8 @@ public:
|
|||||||
void enable();
|
void enable();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// @return true if rdm identify is active
|
||||||
|
bool isIdentifyOn() const;
|
||||||
|
|
||||||
/// 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