API Documentation v0.0.1
Loading...
Searching...
No Matches
LedUpdateState Class Reference

Public Member Functions

void setUpdateFlag (bool requireUpdate)
 Sets the LED update flag in an atomic operation.
 
bool getUpdateFlag () const
 Gets the current state of the LED update flag.
 

Static Public Member Functions

static LedUpdateStategetInstance ()
 Gets the singleton instance of the LedUpdateState class.
 

Detailed Description

Definition at line 30 of file LedUpdateState.h.

Member Function Documentation

◆ getInstance()

static LedUpdateState * LedUpdateState::getInstance ( )
inlinestatic

Gets the singleton instance of the LedUpdateState class.

Returns
Pointer to the singleton instance
See also
This method is called by Board::updateLeds() and other methods that need to check or set the update flag

Definition at line 49 of file LedUpdateState.h.

49 {
50 if (!instance) {
51 instance = new LedUpdateState();
52 }
53 return instance;
54 }

Referenced by Board::fillSolid(), Board::processMode(), Board::setAllLightsOff(), Panel::setAllLightsOff(), Panel::setConsoleLights(), Panel::setFloodlights(), Panel::setIndicatorColor(), Panel::setInstrLights(), Board::updateConsoleLights(), Board::updateFloodLights(), Board::updateInstrumentLights(), and Board::updateLeds().

◆ setUpdateFlag()

void LedUpdateState::setUpdateFlag ( bool requireUpdate)
inline

Sets the LED update flag in an atomic operation.

Parameters
requireUpdateThe new state of the update flag
See also
This method is called by Board methods that modify LED states

Definition at line 61 of file LedUpdateState.h.

61 {
62 cli(); // Disable interrupts (same as noInterrupts())
63 ledsNeedUpdate = requireUpdate;
64 sei(); // Re-enable interrupts (same as interrupts())
65 }

Referenced by Board::fillSolid(), Board::processMode(), Board::setAllLightsOff(), Panel::setAllLightsOff(), Panel::setConsoleLights(), Panel::setFloodlights(), Panel::setIndicatorColor(), Panel::setInstrLights(), Board::updateConsoleLights(), Board::updateFloodLights(), Board::updateInstrumentLights(), and Board::updateLeds().

◆ getUpdateFlag()

bool LedUpdateState::getUpdateFlag ( ) const
inline

Gets the current state of the LED update flag.

Returns
True if LEDs need to be updated, false otherwise
See also
This method is called by Board::updateLeds() to check if a physical update is needed

Definition at line 72 of file LedUpdateState.h.

72 {
73 return ledsNeedUpdate;
74 }

The documentation for this class was generated from the following file: