De-duplicate Ambient LED management code (#5156)

We currently have 4 different places where we have the logic for
modifying LED state of the various types of Ambient LEDs,
ExternalNotificationModule::SetExternalOff
ExternalNotificationModule::SetExternalOn
AmbientLightingThread::setLighting
AmbientLightingThread::setLightingOff

This patch de-duplicates the methods in ExternalNotification to
a single method, using a boolean to toggle whether we're turning
things on or off.
This commit is contained in:
Tom Fifield
2024-10-29 21:41:21 +11:00
committed by GitHub
parent ed03d28a83
commit 2945b9cfbe
2 changed files with 35 additions and 78 deletions

View File

@@ -34,8 +34,7 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency:
uint32_t nagCycleCutoff = 1;
void setExternalOn(uint8_t index = 0);
void setExternalOff(uint8_t index = 0);
void setExternalState(uint8_t index = 0, bool on = false);
bool getExternal(uint8_t index = 0);
void setMute(bool mute) { isMuted = mute; }