Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Jul 30, 2018
1 parent 7e029fb commit 290604c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions src/application/interface/digital/output/leds/LEDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void LEDs::midiToState(midiMessageType_t messageType, uint8_t data1, uint8_t dat
bool setState = false;
bool setBlink = false;

ledControlType_t controlType = database.read(DB_BLOCK_LEDS, dbSection_leds_controlType, i);
ledControlType_t controlType = (ledControlType_t)database.read(DB_BLOCK_LEDS, dbSection_leds_controlType, i);

//determine whether led state or blink state should be changed
//received MIDI message must match with defined control type
Expand Down Expand Up @@ -319,21 +319,21 @@ void LEDs::setAllOff()
setColor(i, colorOff);
}

void LEDs::setColor(uint8_t ledNumber, ledColor_t color)
void LEDs::setColor(uint8_t ledID, ledColor_t color)
{
if (isRGBLEDenabled(board.getRGBID(ledID)))
{
uint8_t led1 = board.getRGBaddress(ledNumber, rgb_R);
uint8_t led2 = board.getRGBaddress(ledNumber, rgb_G);
uint8_t led3 = board.getRGBaddress(ledNumber, rgb_B);
uint8_t led1 = board.getRGBaddress(ledID, rgb_R);
uint8_t led2 = board.getRGBaddress(ledID, rgb_G);
uint8_t led3 = board.getRGBaddress(ledID, rgb_B);

handleLED(led1, BIT_READ(color, 0));
handleLED(led2, BIT_READ(color, 1));
handleLED(led3, BIT_READ(color, 2));
}
else
{
handleLED(ledNumber, (bool)color);
handleLED(ledID, (bool)color);
}
}

Expand Down Expand Up @@ -371,9 +371,9 @@ ledColor_t LEDs::getColor(uint8_t ledID)
}
}

uint8_t LEDs::getState(uint8_t ledNumber)
uint8_t LEDs::getState(uint8_t ledID)
{
return ledState[ledNumber];
return ledState[ledID];
}

bool LEDs::getBlinkState(uint8_t ledID)
Expand Down Expand Up @@ -413,7 +413,7 @@ bool LEDs::setBlinkTime(uint16_t blinkTime)
return true;
}

void LEDs::handleLED(uint8_t ledNumber, bool state, bool rgbLED, rgbIndex_t index)
void LEDs::handleLED(uint8_t ledID, bool state, bool rgbLED, rgbIndex_t index)
{
/*
Expand All @@ -430,7 +430,7 @@ void LEDs::handleLED(uint8_t ledNumber, bool state, bool rgbLED, rgbIndex_t inde
*/

uint8_t currentState = getState(ledNumber);
uint8_t currentState = getState(ledID);

if (state)
{
Expand Down Expand Up @@ -467,7 +467,7 @@ void LEDs::handleLED(uint8_t ledNumber, bool state, bool rgbLED, rgbIndex_t inde
currentState = 0;
}

ledState[ledNumber] = currentState;
ledState[ledID] = currentState;
}

LEDs leds;
6 changes: 3 additions & 3 deletions src/application/interface/digital/output/leds/LEDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LEDs
static void update();
static void setAllOn();
static void setAllOff();
static void setColor(uint8_t ledNumber, ledColor_t color);
static void setColor(uint8_t ledID, ledColor_t color);
static ledColor_t getColor(uint8_t ledID);
static void setBlinkState(uint8_t ledID, bool state);
static bool getBlinkState(uint8_t ledID);
Expand All @@ -46,8 +46,8 @@ class LEDs

private:
static ledColor_t valueToColor(uint8_t receivedVelocity);
static uint8_t getState(uint8_t ledNumber);
static void handleLED(uint8_t ledNumber, bool state, bool rgbLED = false, rgbIndex_t index = rgb_R);
static uint8_t getState(uint8_t ledID);
static void handleLED(uint8_t ledID, bool state, bool rgbLED = false, rgbIndex_t index = rgb_R);

static void startUpAnimation();
};
Expand Down

0 comments on commit 290604c

Please sign in to comment.