Extract LedDriverValues from LedDriverStates to make them public, and make LedDriverStates values private.

This commit is contained in:
László Monda
2017-09-29 15:18:01 +02:00
parent fad17aeb32
commit 877cb78b0a
3 changed files with 21 additions and 20 deletions

View File

@@ -66,13 +66,13 @@ void LedDisplay_SetText(uint8_t length, const char* text) {
allSegmentSets |= characterToSegmentSet(text[0]);
}
LedDriverStates[LedDriverId_Left].sourceLedValues[11] = allSegmentSets & 0b00000001 ? LED_BRIGHTNESS_LEVEL : 0;
LedDriverStates[LedDriverId_Left].sourceLedValues[12] = allSegmentSets & 0b00000010 ? LED_BRIGHTNESS_LEVEL : 0;
LedDriverValues[LedDriverId_Left][11] = allSegmentSets & 0b00000001 ? LED_BRIGHTNESS_LEVEL : 0;
LedDriverValues[LedDriverId_Left][12] = allSegmentSets & 0b00000010 ? LED_BRIGHTNESS_LEVEL : 0;
allSegmentSets >>= 2;
for (uint8_t i = 24; i <= 136; i += 16) {
for (uint8_t j = 0; j < 5; j++) {
LedDriverStates[LedDriverId_Left].sourceLedValues[i + j] = allSegmentSets & 1 << j ? LED_BRIGHTNESS_LEVEL : 0;
LedDriverValues[LedDriverId_Left][i + j] = allSegmentSets & 1 << j ? LED_BRIGHTNESS_LEVEL : 0;
}
allSegmentSets >>= 5;
}
@@ -80,14 +80,14 @@ void LedDisplay_SetText(uint8_t length, const char* text) {
void LedDisplay_SetLayer(uint8_t layerId) {
for (uint8_t i = 13; i <= 45; i += 16) {
LedDriverStates[LedDriverId_Left].sourceLedValues[i] = 0;
LedDriverValues[LedDriverId_Left][i] = 0;
}
if (layerId >= LAYER_ID_MOD && layerId <= LAYER_ID_MOUSE) {
LedDriverStates[LedDriverId_Left].sourceLedValues[16 * layerId - 3] = LED_BRIGHTNESS_LEVEL;
LedDriverValues[LedDriverId_Left][16 * layerId - 3] = LED_BRIGHTNESS_LEVEL;
}
}
void LedDisplay_SetIcon(led_display_icon_t icon, bool isEnabled) {
LedDriverStates[LedDriverId_Left].sourceLedValues[8 + icon] = isEnabled ? LED_BRIGHTNESS_LEVEL : 0;
LedDriverValues[LedDriverId_Left][8 + icon] = isEnabled ? LED_BRIGHTNESS_LEVEL : 0;
}