mirror of
https://github.com/wled/WLED.git
synced 2025-04-19 12:27:17 +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;
|
||||
}
|
||||
|
||||
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
|
||||
if (identify && gotIdentify)
|
||||
if (isIdentifyOn())
|
||||
{
|
||||
DEBUG_PRINTLN("RDM Identify active");
|
||||
turnOnAllLeds();
|
||||
}
|
||||
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
|
@ -17,6 +17,8 @@ public:
|
||||
void enable();
|
||||
|
||||
private:
|
||||
/// @return true if rdm identify is active
|
||||
bool isIdentifyOn() const;
|
||||
|
||||
/// overrides everything and turns on all leds
|
||||
void turnOnAllLeds();
|
||||
|
Loading…
x
Reference in New Issue
Block a user